This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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 Head First Android this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interface implementation problem
 
It's not a secret anymore!