Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract and interface

 
Arathi Rajashekar
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Can an interface be declared abstract. I tried to compile the following code
public abstract interface a{
public void b();
}
It compiled fine. with out errors. If we can declare an interface as abstract interface, what is the use of it?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an answer
http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#30820
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Fei Ng
Ranch Hand
Posts: 1244
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Becuase they are abstract?? Still not quite when to use interface though.
good luck.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic