Hi Guoqiao, According to me 2 is correct. You can see it by just writing a small code. Gurpreet Sachdeva For mock exams and other useful pages related to JCP plz. visit: http://www.go4java.20m.com [This message has been edited by Gurpreet Sachdeva (edited August 17, 2001).]
Regards<BR>Gurpreet Sachdeva<P>For Mock Exams, FAQ, Exam tips and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: <A HREF="http://www.go4java.lookscool.com" TARGET=_blank rel="nofollow">http://www.go4java.lookscool.com</A>
It is easy to test, but #2 is the correct answer... try: String ref = null; if( ref instanceof Object ) System.out.println(true); else System.out.println(false); nullref instanceof anything will always be false... even nullref instance of nullRefType String ref = null; if( ref instanceof String ) System.out.println(true); else System.out.println(false); } also prints out false... The tricky part of your question, however, is should String ref = null; be considered a "reference"?
[This message has been edited by Guy Reynolds (edited August 17, 2001).]