IntelliJ Java IDE
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes some questions ... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "some questions ..." Watch "some questions ..." New topic
Author

some questions ...

Milind Mahajan
Ranch Hand

Joined: Oct 23, 2000
Posts: 77
Hi,
I have a couple of doubts. Can somebody help me ?
True or False :
1. An instance of anonymous inner class can only be created in it's outer class.
( My answer is true. Mock exam author says false )
2. Object refernces that are not initialized explicitly will have their value set to null always.
( My answer is true. Mock exam author says false )
One more thing. Are we expected to memorize precedence of operators for SCJP exam ?
Thanks
Milind
Amit Tyagi
Ranch Hand

Joined: Oct 18, 2000
Posts: 52
Hi Milind ,
The answer to the first quest. should be false only.
and for the second quest. also it should be false.
example>>>> ref. var. declared inside the mathod body(i.e. local) will not be set to null.
Amit
Niraj Sheth
Greenhorn

Joined: Oct 26, 2000
Posts: 16
Hi.
I also think answer to first question should be true. Can you explain that why it should be false.
Thanks
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
I think the reason it is false is because you can nest an inner class inside of another inner class. You can go as deep as you want, so an anonymous class can be a method of the outer class or it can be in a method of an inner class.
Bill
 
 
subject: some questions ...
 
Threads others viewed
File class
question about interfaces
Confidentiality
Boxing and unboxing in Java 5
Garbge collector !!!
IntelliJ Java IDE