aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes K&B Mock Exam Question 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 "K&B Mock Exam Question" Watch "K&B Mock Exam Question" New topic
Author

K&B Mock Exam Question

Anthony Zepezauer
Greenhorn

Joined: Nov 09, 2007
Posts: 2
Ok I have to be missing something here but I've gone over and over it and just can't see it. Here's a question from the mock exam on the CD that came with K&B (line numbers added by me):



I selected the "Does not compile" option, because:

* line 11 is calling a no-args constructor;
* there is a constructor with args defined on line 6, therefore there will be no default constructor supplied;
* no no-args constructor is explicitly defined.

But I was wrong, I tried it and this code does compile and run. What am I missing??? Any help is appreciated.

[ November 09, 2007: Message edited by: Anthony Zepezauer ]
[ November 09, 2007: Message edited by: Anthony Zepezauer ]
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
"No arguments" is a valid value for a varargs parameter. The constructor will simply be called with an array of length 0.


SCJP 5.0
Anthony Zepezauer
Greenhorn

Joined: Nov 09, 2007
Posts: 2
Ohhhhh. Thanks Kelvin.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: K&B Mock Exam Question