GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Kb question pg 660 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 "Kb question pg 660" Watch "Kb question pg 660" New topic
Author

Kb question pg 660

Dinesh Tahiliani
Ranch Hand

Joined: Aug 06, 2007
Posts: 486
class BOO
{

BOO(){}
BOO(String s){}
}

class Bar extends BOO
{
Bar(){}
Bar(String s){ super(s);}
void zoo
{

insert cde
}
}

Options are :
1. BOO f = new Bar(){}
2. BOO f = new BOO() { String s;}
3. Bar f = new BOO(){ String s;}

ANswers are 1 and 2

Can anyone please me this


Thanks<br />Dinesh
Minu Jain
Ranch Hand

Joined: Mar 24, 2008
Posts: 74
Option 1 is correct because Boo is a superclass of Bar.
Option 2 is correct for obvious reasons.
Option 3 is incorrect because Bar is a subclass of Boo.

Hope the explanation is enough!


SCBCD5, SCWCD5, SCJP5
"Even if you're on the right track, you'll get run over if you just sit there."
 
GeeCON Prague 2014
 
subject: Kb question pg 660