• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any meaning to an abstract modifier for an interface?

 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are all interfaces implicitly abstract? Along the same lines, are all interface method declarations implicitly abstract?
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the JLS, §9.1.1.1 abstract Interfaces

Every interface is implicitly abstract. This modifier is obsolete and should not be used in new programs.

Also from the JLS, §9.4 Abstract Method Declarations:

Every method declaration in the body of an interface is implicitly abstract, so its body is always represented by a semicolon, not a block.

I expect that answers your questions.
Corey
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Brian
The answer is Yes. You can implicitly put the keyword abstract in front of the method or the interface if you wish but that is not recomended.
[ June 03, 2003: Message edited by: Anupam Sinha ]
 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks once again. I admit, I still find the JLS a bit difficult to read, so it isn't my first choice to find my answers, at least not yet...
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Joseph:
Thanks once again. I admit, I still find the JLS a bit difficult to read, so it isn't my first choice to find my answers, at least not yet...

The JLS can be a bit daunting, but it's the #1 source for answers when it comes to Java. Get used to looking through it - believe me, it gets easier with practice. After a while, you get to know it so well, you know right where to look for handy quotes to answer questions. :roll:
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Corey
Do refer to the JLS on the computer or you refer to a hard copy of the JLS. I mean which do you find easier.
[ June 03, 2003: Message edited by: Anupam Sinha ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic