aspose file tools*
The moose likes Beginning Java and the fly likes Doubt in Interface 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 » Java » Beginning Java
Bookmark "Doubt in Interface" Watch "Doubt in Interface" New topic
Author

Doubt in Interface

Sunil atluri
Greenhorn

Joined: Jun 28, 2004
Posts: 2
Hi ,
Can a abstract class extend an interface.?
Chris Allen
Ranch Hand

Joined: Feb 01, 2003
Posts: 127
Ummm, I don't think you can extend an interface with a class. You can however implement an interface with an abstract class as shown below:


You can also extend an interface with another abstract interface as shown below:


Does this answer your question?
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
From the Java Language Specification:
9.1.1.1 abstract Interfaces
Every interface is implicitly abstract. This modifier is obsolete and should not be used in new programs.


Mike Gershman
SCJP 1.4, SCWCD in process
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
short answer: no.
Classes can never extend interfaces just as interfaces can never extend classes.

Interfaces extend interfaces, classes extend classes.

Classes (whether abstract or not) can IMPLEMENT interfaces.


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Interface