aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Any meaning to an abstract modifier for an interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Any meaning to an abstract modifier for an interface?" Watch "Any meaning to an abstract modifier for an interface?" New topic
Author

Any meaning to an abstract modifier for an interface?

Brian Joseph
Ranch Hand

Joined: May 16, 2003
Posts: 160
Are all interfaces implicitly abstract? Along the same lines, are all interface method declarations implicitly abstract?
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
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


SCJP Tipline, etc.
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
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

Joined: May 16, 2003
Posts: 160
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

Joined: Dec 20, 2001
Posts: 3271
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

Joined: Apr 13, 2003
Posts: 1088
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any meaning to an abstract modifier for an interface?