This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock question." Watch "Mock question." New topic

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.

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.

subject: Mock question.
Similar Threads
static variable vs final variable!
overriding compareTo
How does this work
Q 10, Self test, K and B.
Garbage Collection Clarification