wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Interface implementation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interface implementation problem" Watch "Interface implementation problem" New topic
Author

Interface implementation problem

Kumar Sushil
Greenhorn

Joined: Jan 31, 2006
Posts: 29
I found this Q. in mock Exam

interface TestA {
String toString();
}

public class Test implements TestA{
public static void main(String[] args){
System.out.println("hello");
}
}

If, we implement an interface, this is necessary that we implement methods of that interface. But here this not happening. Is this due to toString() method of Object class?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by johny martin:
...Is this due to toString() method of Object class?

Yes, the implementation is inherited from Object.


"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
 
wood burning stoves
 
subject: Interface implementation problem