betweenGo

Interface Members

by on Jun.13, 2008, under Java SE

Because interfaces are static, public and don’t change, by definition any members you declare in them are static, public and final. Therefore you don’t need to qualify such members.

For example:

public interface A {
  String FOO = "foo";
}

is the same as:

public interface A {
  public final static String FOO = "foo";
}

You can read some more about this in the forum Interface member variable by default static?

Share

Related posts:

  1. Static Import
  2. Accessing JavaBean’s Getters and Setters
  3. Dynamically generate sitemap.xml
  4. Find a class’s runtime origin
  5. Programming Secure FTP in Java

:

Leave a Reply

 

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!