aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes a doubt on interfaces & classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

a doubt on interfaces & classes

sunetra sen
Greenhorn

Joined: Oct 15, 2002
Posts: 11
PLEASE SEE THE FOLLOWING PROG:
interface C {
char w = DD.echo('w');
char x = DD.echo('x');
}
interface D extends C {
char y = DD.echo('y');
char z = DD.echo('z');
char a = DD.echo(w);
}
class DD implements D {
static char echo(char c) {
System.out.print(c);
return c;
}
public static void main (String[] args) {

System.out.print("Main");
DD dd = new DD();
System.out.println(a);
}
}

IT GIVES OUTPUT AS:
Mainyzwxww
CAN SOMEBODY PLEASE CLARIFY HOW THIS OUTPUT IS OBTAINED.
THANKS.
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Sunetra,
Thank you for using my exam.
Please see the following.
http://www.coderanch.com/t/239579/java-programmer-SCJP/certification/Interfac-initialisation-rules


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a doubt on interfaces & classes