Nitish Bangera wrote:well its just passion and love for knowledge.Also SCJA covers much more in theory.Come to think of it why do SCJP....can't you go directly and give SCEA.
Henry Wong wrote:
but I see scjp ranchers studying for the scja...
Can you provide some links to JR topics pertaining to this?
Jesper Young wrote:
armando fonseca wrote:Numbers between -128 and 127 will give true when using wrappers and the equality ==.
But that is in this case not why the second answer is 'true'!
The fact that == returns true in some cases is because classes like Integer have a cache of Integer objects for all the values between -128 and 127, and if you call Integer.valueOf(int) with a value in that range, the method will return an Integer object from the cache. Note that autoboxing calls Integer.valueOf(int) to automatically box an integer.
In the case above, S2 is created with the new operator. It is not an object from the cache - even though the value is 7. When you compare it to an object from the cache, the result will be false.
Anastasia Sirotenko wrote:
armando fonseca wrote:hey guys, i'm trying to find a way using default package or in other words, not using a package name space.
I don't see a way to do this. The F class inside the main() method shadows the outer F class. And if i am right, the same way as you cannot reach the shadowed variables, you cannot reach the shadowed class...