Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

compare numbers in array in java

for (int i = 0; i < a.length; i++) 
{
    for (int k = i+1; k < a.length; k++) 
    {
        if (a[i] != a[k]) 
         {
            System.out.println(a[i]+"not the same with"+a[k]+"
");
        }
    }
}
 
PREVIOUS NEXT
Tagged: #compare #numbers #array #java
ADD COMMENT
Topic
Name
4+2 =