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
posted
0
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