I am trying to display duplicate string from an array but the code is not working.For example:In the word "arrow" r is coming two times shoq the code should display the output 'r'.But it is not displaying anything
public class duplicatearray {
public static void main(String[] args)
{
String[] s={"arrow"};
for(int i=0;i<s.length;i++)
{
for(int j=i+1;j<s.length;j++)
{
if(s[i].equals(s[j]))
{
System.out.println("Duplicate value"+s[i]);
}
}
}
}
}