Hi ..
You can compare like this.....
int [] numbers={1,2,3,4,5};
int comp=0;
for(int j=0;j<numbers.length;j++){
if (comp == numbers[j] ) {
// <==error here (" cannot compare int
with int[] ")
System.out.println("We can compare like
this...");
}
}
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of nguyen
thanh lam
Sent: Thursday, July 23, 2009 3:28 PM
To: Free Java Programming Online Training Course By Sang Shin
Subject: [java programming] compare an int
Int numbers={1,2,3,4,5}
int comp;
if (comp == numbers[] ) // <==error here (" cannot compare int with
int[] ")
I want to compare a variable with many others. how i should do?
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---