This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interface" Watch "Interface" New topic
Author

Interface

jyoti Viv
Greenhorn

Joined: Jun 08, 2005
Posts: 3
My question is if all membars of an interface are by default static final then explicitly defining them in the declaration will make any difference?
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Every field declaration in the body of an interface is implicitly public, static and final. It makes no difference whether or not you use these modifiers in your declaration.

In a similar way, every interface method is implicitly public and abstract, so the following are all identical:

void go();
public void go(); // not recommended
abstract void go();
public abstract void go(); // not recommended


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
 
Consider Paul's rocket mass heater.
 
subject: Interface
 
Similar Threads
Home interface or Home Interface stub
Time Capsule
Writing an Interface
How To Call Two Different Classes From the Main Program Using the Same API?
Regarding Interfaces