File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Doubt in Interface" Watch "Doubt in Interface" New topic

Doubt in Interface

Sunil atluri

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: 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.

I agree. Here's the link:
subject: Doubt in Interface
It's not a secret anymore!