• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package (default) access interface declarations

 
Leo Velazquez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you declare an interface without a public modifier
making it package (default) access and you don't put any
modifiers on any of its methods or fields, are the methods
still implicitly public and the fields public,static, and final
or are the methods implicitly package (default) access
with the fields being package access, static, and final?
Thanks in advance to whoever can solve the mystery.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The public-ness of the members of an interface doesn't depend on the public-ness of the interface itself. All interface methods are public, and all fields are public static final.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic