File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes interface and abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "interface and abstract class" Watch "interface and abstract class" New topic
Author

interface and abstract class

Shilpa Jain
Greenhorn

Joined: Aug 17, 2000
Posts: 16
Can an abstract class implement an interface?
Thank you
Thomas Misik
Greenhorn

Joined: Sep 30, 2000
Posts: 16
Shilpa Jain,
I think the answer to that is yes because interfaces are abstract by default. Abstract classes are just templates you design yourself, so I don't see why you couldn't implement an interface (as long as the methods were left unwritten....public void actionPerformed(ActionEvent e){empty}). Since you are allowed to have non-abstract methods in an abstract class, and interfaces & their methods are assumed to be abstract, I can't see why you couldn't implement them. I could be wrong here, so maybe one of the Java gurus could post a definitive answer.
Regards,
Thomas
Thomas Misik
Greenhorn

Joined: Sep 30, 2000
Posts: 16
NOTE: abstract methods CAN have regular methods, please disregard the comments on the interface method having to be empty.
Thomas
Shilpa Jain
Greenhorn

Joined: Aug 17, 2000
Posts: 16
Thank you Thomas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interface and abstract class