Should I declare the constants in my interface as public final static, and my methods as public abstract?

John Zukowski

The use of the these modifiers in interfaces is completely optional. The following point out the relevant sections of the Java Language Specification:

  • According to the section 9.1.5: All interface members are implicitly public.
  • According to section 9.3: Every field declaration in the body of an interface is implicitly public, static, and final
  • According to section 9.4: Every method declaration in the body of an interface is implicitly public and Every method declaration in the body of an interface is implicitly abstract
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact