This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
Consider Paul's rocket mass heater.
 
subject: Doubt in Interface
 
Similar Threads
How To Call Two Different Classes From the Main Program Using the Same API?
Home interface or Home Interface stub
Time Capsule
Writing an Interface
Regarding Interfaces