Комментарии:
Please I have a project based on voting online management system, please how can I do it 🙏
ОтветитьString a="abcdef";
String b="dghijk";
String c= "lmnopa"; can any one help me from these 3 strings to be compared and find duplicates in java8
Good explanation, just needed more clarity on the reason why we are assigning value of string[j] = 0, as i believe while traversing string from left to right, we already have compared that value to that of i, so what is the use ?
ОтветитьThe program is wrong for some string valure like
Imagine
String str= ssss;
Your repeated value will print like this
4
3
2
Try it
is this code correct way of writing sir
public class Rough {
public static void main(String[] args) {
String str = "hi this is java language";
for (int i = 0; i < str.length() - 1; i++) {
int count = 0;
for (int j = i + 1; j < str.length(); j++) {
if (str.charAt(i) == str.charAt(j)&& str.charAt(i)!=' ') {
count++;
}
}
if (count == 1) {
System.out.print(str.charAt(i)+" ");
}
}
}
}
what if more than twice the characters are repeated ??
ОтветитьThanks for the video! from Ottawa.
Ответитьsecond one not string it's a char array sir
ОтветитьThank You
Ответить