File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Interface implementation problem
 
Similar Threads
interface implementation problem
doubt in interface
Calling interface ?
constructor question
toString is overrides Object Class or TestA