This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock question doubt... 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 "Mock question doubt..." Watch "Mock question doubt..." New topic

Mock question doubt...

Bram Maes
Ranch Hand

Joined: Sep 27, 2006
Posts: 32

The correct answer is "This doesn't compile".
This invocation will search for a function named test. It does not invoke the overloaded test() constructor.

I don't get this. Why is that ?? How can you do what's meant to do here ?


SCJP 5.0, SCEA part I
Anand Loni
Ranch Hand

Joined: Jan 20, 2006
Posts: 150

First statement in Constructor can only be:

1) Call to superclass's constructor by super call.
2) Call overloaded constructor using this call.

Thats why its will search for method named same as class name.


~ Anand,
SCJP 1.5, SCWCD 1.5
Bram Maes
Ranch Hand

Joined: Sep 27, 2006
Posts: 32
So this(2) should work then ?
Max Habibi
town drunk
( and author)

Joined: Jun 27, 2002
Posts: 4118

Java Regular Expressions
Bram Maes
Ranch Hand

Joined: Sep 27, 2006
Posts: 32
These are the kind of questions I hate. Really those subtle differences. Half a second losing your attention and bang...

And of course thanks a lot for the clarification!
[ October 27, 2006: Message edited by: Bram Maes ]
GeeCON Prague 2014
subject: Mock question doubt...