aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes super(10) 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 "super(10)" Watch "super(10)" New topic
Author

super(10)

Netty poestel
Ranch Hand

Joined: Sep 20, 2004
Posts: 131
//code:-

package spital;

public class Mudchute extends Spital{
public static void main(String argv[]){

Mudchute ms = new Mudchute();
ms.go();
}
public Mudchute(){
super(10);
}
public void go(){
island();

}
public void island(){
System.out.println("island");
}

}

THE answer is "Output of 10 followed by island"
I'm fine on 'island'...the '10' needs clarification.

http://java.sun.com/docs/books/tutorial/java/javaOO/methodbody.html
states:
"super
If your method hides one of its superclass's member variables, your method can refer to the hidden variable through the use of the super keyword. Similarly, if your method overrides one of its superclass's methods, your method can invoke the overridden method through the use of the super keyword. "
afaics...super(10); is neither hiding a variable or a method in the super class [ or is it ? ]
TIA
Louie van Bommel
Ranch Hand

Joined: Aug 17, 2004
Posts: 76
We can't answer your question unless you include the code for the class Spital.
Louie van Bommel
Ranch Hand

Joined: Aug 17, 2004
Posts: 76
Originally posted by Louie van Bommel:
We can't answer your question unless you include the code for the class Spital.



Oh ya, that's Marcus' tutorial question. I'm pretty sure it's an error in the question.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Louie van Bommel:
I'm pretty sure it's an error in the question.

Yeah, we would need to know what the int-argument constructor for Spital looks like. Evidentially, it's supposed to be something like this...

Ref: http://www.jchq.net/certkey/0401certkey.htm


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: super(10)