Tuesday, September 3, 2013

how to compare an integer from an arraylist

how to compare an integer from an arraylist

I have this piece of code:
public static ArrayList type = new ArrayList<Integer>();
///////////some code//////////
System.out.println(normalization.type.get(i));
System.out.println(normalization.type.get(i) == "1");
it gives me output
1
false
I have tried single quotes and equals methods, still doesn't match. Any
ideas ??

No comments:

Post a Comment