How to compare arraylist value and array value in java -


int sizeoftheshortestlist = webresult.size();     (int i=0; i<sizeoftheshortestlist; i++) {         if (webresult1.get(i).equals(dbresult[i]) )         {           system.out.println("equals..: " + webresult1.get(i));      }  } 

from above code find errors please give solution compare arraylist values , array values

take arraylist 'al'. take array 'a'.

now u need compare 'al' , 'a'.

iterator = new iterator(al); int length = a.size(); int count=0; for(int i=0;i<length; i++) {     if(it.next()==a[i]);     {         count++;     } } if(count == length) {     system.out.println("both equal"); } else {     system.out.println("both not equal"); } 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -