26 - Java Program to find the duplicate characters in a string.

preview_player
Показать описание

Here we will learn a Java Program to find the duplicate characters in a string.

Additional Info

and press the bell icon to get updates on latest tutorial.

#softwaretestingandautomation #subhasishmishra #softwaretesting #selenium #apitesting #java #restassuredapiautomation #testng #sql #unix #automationtesting #softwaretestinginterviewquestionandanswers #testautomation
Рекомендации по теме
Комментарии
Автор

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 ?

KaranSharma-lmeh
Автор

Please I have a project based on voting online management system, please how can I do it 🙏

clareogochukwu
Автор

what if more than twice the characters are repeated ??

rohitmiryala
Автор

second one not string it's a char array sir

MahirCayan
Автор

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)!=' ') {

}
}
if (count == 1) {
");
}
}

}
}

sainihash
Автор

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

harshithac-en
Автор

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

Mastergames
join shbcf.ru