aspose file tools
The moose likes Beginning Java and the fly likes Interface implementation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Interface implementation problem
 
Similar Threads
toString is overrides Object Class or TestA
doubt in interface
Calling interface ?
constructor question
interface implementation problem