jQuery in Action, 2nd edition*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes corrections in marcus green test1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "corrections in marcus green test1" Watch "corrections in marcus green test1" New topic
Author

corrections in marcus green test1

Bob Mathews
Ranch Hand

Joined: Feb 26, 2006
Posts: 43
hi all

i have just appeared in the marcus green test no 1.
11 questions were not in the current sylabus for scjp1.4

And question 59 says

class Base{
private void amethod(int iBase){
System.out.println("Base.amethod");
}
}
class Over extends Base{
public static void main(String argv[]){
Over o = new Over();
int iBase=0;
o.amethod(iBase);
}
public void amethod(int iOver){
System.out.println("Over.amethod");
}
}
1) Compile time error complaining that Base.amethod is private
2) Runtime error complaining that Base.amethod is private
3) Output of "Base.amethod"
4) Output of "Over.amethod
Answer :4

but i think Answer should be compile time error as none of the classes are public

correct we if i m wrong

And i have scored 41 correct of those 49 questions 84% roughly

what u ranchers suggest ?

regards
Nishant
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

I compiled and ran it to get Over.amethod. None of your classes need to be public. The rule is that if a class is public it must have the same name as the file name and no more than one public class is allowed per file.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Notice that the second amethod is inside the definition of Over.
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
Two points,
It says very clearly in large letters at the top of the exam
"This exam is based on the objectives of the JDK 1.2 exam.
You can see set of 60 questions for the JDK1.4 exam at JDK1.4 Exam"
(with hyperlink to http://www.jchq.net/phezam.


The other is that when you come accross an issue such as this you are best advised to compile the code yourself to see what happens. Javac is the best friend of the exam candidate.

Your feedback is appreciated, keep posting


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
 
Consider Paul's rocket mass heater.
 
subject: corrections in marcus green test1