File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes is it righ? 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 "is it righ?" Watch "is it righ?" New topic

is it righ?

Naresh Saw
Ranch Hand

Joined: Sep 03, 2005
Posts: 66
class Base{
public Base(int i){}

public class MyOver extends Base{
public static void main(String arg[]){
MyOver m = new MyOver(10);

MyOver(int i){

MyOver(String s, int i){


which of the following can be inserted at //Here without compile time error
1)MyOver m = new MyOver();
4)Base b = new Base(10);

According to me Answer should be 1 & 4.

Please correct me if i m wrong.

naresh<br />SCJP 1.4(86%), SCWCD 1.4(78%)
Naresh Saw
Ranch Hand

Joined: Sep 03, 2005
Posts: 66
sry guys i got the answer.

Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Every mock exam I've seen provides the correct answer along with an explanation. Which exam does this question come from?

I believe your answer is incorrect, though, and a quick test should verify this...
[ September 15, 2005: Message edited by: Steve Morrow ]
Patrick Williams
Ranch Hand

Joined: Apr 03, 2005
Posts: 213
1 would not be correct because there is no default constructor defined, but there are two defined that take parameters (so that means that the default is not created by the compiler). The only correct answer is 4.

Patrick<br /> <br />SCJP/SCWCD/SCBCD/SCDJWS/SCEA<br /> <br />Currently working on:<br />SCJP 6
I agree. Here's the link:
subject: is it righ?
It's not a secret anymore!