Thursday, July 9, 2009

What's it gonna be?

Finally, THE TEST!

If everything goes well, I will get certified tommorow. After writing tons of code samples, reading the book, practicing with Mock test I am still not sure what's it gonna be!

Today I've learned something new! Would you expect something like this could print "true"?

Integer i = 18;
Integer j = 18;
System.out.println(i == j);


Interetingly, all samples shown below will print "false":

Integer i = 18;
Integer j = new Integer(18);
System.out.println(i == j);

...

Integer i = 128;
Integer j = 128;
System.out.println(i == j);

...

Integer i = new Integer(18);
Integer j = new Integer(18);
System.out.println(i == j);


Eeeh? Yes! Try it yourself! I'm not kidding! And there is more examples similar to the one shown above (e.g. Double.NaN == Double.NaN ... returns false).

Well, it's gonna be tough, that's for sure!

Wish me luck!

No comments: