Originally posted by enen:
What are runtime exceptions as far as JVM and programmtic exceptions mentioned above is concerned?
The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).
Originally posted by Carlos Gomez:
Because the Integer class override the equals method and certain primitives are always to be boxed into the same immutable wrapper objects. These special values are:
The boolean values true and false
The byte values
The char values in the range '\u0000' to '\u007F'
The short and int values between -128 and 127
Integer j1 = 148;
Integer j2 = 148;
System.out.println(j1 == j2); // FALSE
Integer k1 = 126;
Integer k2 = 126;
System.out.println(k == k); // TRUE
Originally posted by Vaibhav Chauhan:
Thanks Jasiek and Neelesh ....I agree with you but tell me that if subclass overridding method throw a wider exception (say Exception) whereas the superclass overridden method throw NullPointerException, then compiler should be glad because anyway we are handling NullPointerException (and ofcourse some more exceptions) through "Exception" in subclass overridding method. It ensures that anyhow we are taking care of NullPointerException.