This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Page 659 Q1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Page 659 Q1" Watch "Page 659 Q1" New topic
Author

Page 659 Q1

Thomas Jonsson
Greenhorn

Joined: Dec 18, 2006
Posts: 2
Hi,

Isn't the D option correct as well?
MyInner m = new MyOuter.MyInner();

It compiles and runs.

My english may fool me.

All the best,
Thomas
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Page 659 of what?

Many people do not have the book you have, so please make the effort to give as much information as possible about the problem.
[ December 18, 2006: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

It is from the K&B book. I feel that only option A is correct. You cannot refer to an inner class without an outer reference. Option D would be correct if you have an import statement that imports the outer class in some other package. Watch the question as it asks in some other package. If it were in the same package, then option d is also correct.
[ December 18, 2006: Message edited by: Jothi Shankar Kumar Sankararaj ]

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Thomas Jonsson
Greenhorn

Joined: Dec 18, 2006
Posts: 2
No I see. Thank you!

And I will be more precise in my coming questions...
 
GeeCON Prague 2014
 
subject: Page 659 Q1