File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Page 659 Q1

Thomas Jonsson

Joined: Dec 18, 2006
Posts: 2

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,
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: 10032

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

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

And I will be more precise in my coming questions...
I agree. Here's the link:
subject: Page 659 Q1
jQuery in Action, 3rd edition