Insight
Monday, September 3, 2012
Java Puzzle
Java puzzle on equal and == comparision operators:
public
class
Test {
public
static
void
main(String[] args) {
int
x = 7;
Integer y =
new
Integer(7);
System.
out
.println(x == 7);
System.
out
.println(y.equals(x));
}
}
Output:
true
true
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment