Sir ,This program logic is not working when we have a string like "aabbjgghh" . Because when i =1 and iteration continues , again character ''a' will be unique .
intha program la verum first letter matum tha compare pandranga.... matha letters compare agala..... "welcome " potu patha 'w' matum tha compare aguthu.... could you please correct this program sir..
Sir ,This program logic is not working when we have a string like "aabbjgghh" . Because when i =1 and iteration continues , again character ''a' will be unique .
Hello sir can you please upload the same program for the integers ? First non repetitive numbers?
Hai sir...I'm learning java from ur channel ..it is possible to post some videos on java swing concept
Thank you Sir
Compare two strings sir
intha program la verum first letter matum tha compare pandranga.... matha letters compare agala..... "welcome " potu patha 'w' matum tha compare aguthu.... could you please correct this program sir..
public class FirstNonRepeatedChar {
public static void main(String arg[]) {
System.out.println("main method");
String str = "khabcahbcde";
int length = str.length();
for (int i = 0; i < length; i++) { // pass the string
boolean isRepeated = false;
for (int j = 0; j < length; j++) { // check first non reperated char
if(str.charAt(i) == str.charAt(j) && i != j) {
isRepeated = true;
break;
}
}
if(!isRepeated) {
System.out.println(str.charAt(i) + " is not repeated");
break;
}
}
}
}
String la == use pannakudathunu solringa apram y inga use panringa
adhu character a compare panranga. not string
Hi