Originally posted by Tony Smith:
Seems like it's smart enough to autobox and add it to the set, however it is not smart enough to autobox and remove from the set if you don't specify it's (short). I tried ss.remove((short)0); and that seems to do the job. Is that more like a security feature or?
Originally posted by dolly shah:
Here why add() method allows s++ entry two times?
I thought the answer is runtime error but answer is 3. I thought ss.remove(1) gives nullPointer exception, as ss.add(s++) 2nd time in add() method gives false.
Originally posted by B Misra:
This may be a foolish question, but i am suddenly confused with the instance variables & overriding(rather hiding) them in subclasses of any class.....
while accessing hidden/overridden instance variables the accessed depends on the object's reference type only?