Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes my question about interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "my question about interface?" Watch "my question about interface?" New topic
Author

my question about interface?

Tony Sam
Ranch Hand

Joined: Nov 19, 2001
Posts: 32
From javaprepare.com ...
Which of the following are true about interfaces. Select all
correct answers.
A)Methods declared in interfaces are implicitly private.
B)Variables declared in interfaces are implicitly public,
static, and final.
C)An interface can extend any number of interfaces.
D)The keyword implements indicate that an interface
inherits from another.
I think the answer must be B), but c) is also added in the correct answer.
My opinion about interface is that, all variables in interface are implicitly public ,static and final, all methods in interface are impilicitly public abstract ,and interface also can be declared as abstract . interface can only extends other interface, it must use the key word extends, how could an interface extends more than mone other interface? Correct me if i was wrong!

Tony Sam<BR>One want to be a SCJP...
amit mawkin
Ranch Hand

Joined: Oct 31, 2001
Posts: 73
Hi,
This is true an interface can extend any number of interface.
Consider this code
<code>
interface A {
public void amethod1();
}
interface B {
public void amethod2();
}
interface C extends A,B {
public void amethod3();
}
</code>
see for yourself

------------------
coffee drinker
-----------------------
Sun Certified Programmer for Java 2 Platform


regards, Amit
coffee drinker and Sun Certified Programmer for Java 2 Platform
Tony Sam
Ranch Hand

Joined: Nov 19, 2001
Posts: 32
okay, thank you very much . Coding may sometimes disclose everything
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Originally posted by Tony Sam:
okay, thank you very much . Coding may sometimes disclose everything

Not sometimes, ALWAYS
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
jQuery in Action, 2nd edition
 
subject: my question about interface?
 
Similar Threads
Q. interface definitions
Interface question
Interface question
Inheritance
Interface Theory