I have the following code where i want to retrieve only those values which are duplicate but could not find the right result.I don't know where i'm wrong.
public class TestDummy {
public static void main(String args[]){
String arr[] ={"lady", "bird", "is","bird","lady","cook"};
int len = arr.length;
System.out.println("Size "+len);
for(int i=0 ; i<=len;i++){
for(int j=1 ; j< len-1;j++){
if(arr[i]==arr[j]){
System.out.println("Duplicate "+arr[i]);
}
}
}
}
}
for(int i=0 ; i<**=**len;i++){. Can you spot it?