File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock question." Watch "Mock question." New topic
Author

Mock question.

jamil lusa
Ranch Hand

Joined: Aug 18, 2011
Posts: 59
Hi all, i am practising the mock test questions from the OCP java SE 6 Programmer Practice Exams. There is a question i could not figure out:



What do you all think about the answer?
John Stark
Ranch Hand

Joined: Jul 19, 2011
Posts: 185
I think forandboth this and b in the go() method refer to the same object. Therefore this can be replaced by b which makes it a bit more readable.
In the case of go() is called from within go(). Thereforeis done twice resulting in being 7. The answer is 2 7 then.

John
Jagdev Singh
Ranch Hand

Joined: Jan 12, 2010
Posts: 71

I think answer should be 2 7.
The question is related to method call using reference variables.

hth
Jagdev
 
wood burning stoves
 
subject: Mock question.