This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question from marcus green mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Question from marcus green mock exam" Watch "Question from marcus green mock exam" New topic
Author

Question from marcus green mock exam

Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442

1) Compile Error: Methods in Base not found
2) Compile Error: Unable to access protected method in base class
3) Compilation followed by the output "amethod"
4)Compile error: Superclass Class1.Base of class Class1.Class1 not found

Ans given is 4
but i cheked ,it compiles & runs fine with o/p amethod.Shouldn't the answer be 3?
Thanks
Veena
[ Jess fixed the code so you can actually read it, please be more careful when cutting and pasting code so that we can read it and help! ]
[ October 20, 2003: Message edited by: Jessica Sant ]

SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Hi Veena, can you make it more readable? I had hard times reading the code.
These classes are in different packages, Base.java is marked as default access, and, to make things worse, package Base is not imported into Class1.java. This shouldn't compile.
P.S. Thanks Jess, I thought it was local on my computer.
[ October 20, 2003: Message edited by: Vad Fogel ]
[ October 20, 2003: Message edited by: Vad Fogel ]
Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442
Oh!I got it.Thanks and really sorry for pasting code as it is.
Thanks
Veena
 
Consider Paul's rocket mass heater.
 
subject: Question from marcus green mock exam
 
Similar Threads
Marcus Green's exam #2
classes in different package
Marcus Green "package question"
Kind Attn:Marcus Green - Pl. clear doubt
Need help for Marcus exam No1 #58