java : operator example

java : operator example

public class Array2 {

public static void main(String[] args) {
int[] arr={1,2,3,4,5,0,0,1,3};
Outer:for(int i=0;i<arr.length;i++){
Innter: for(int j=i+1;j<arr.length;j++){
if(arr[i]==arr[j]){
System.out.println(arr[i]);
break Outer;
}
}
}
/*String s="ffaghglklklh";
Outer:for(int i=0;i<s.length();i++){
Innter: for(int j=i+1;j<s.length();j++){
if(s.charAt(i)==s.charAt(j)){
System.out.println(s.charAt(i));
break Outer;
}
}
}*/
}

}

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation