Name Static Methods For Static Import

last modified: August 28, 2009

One of the JavaIdioms.

When creating static methods in JavaLanguage 5 or greater, give consideration to how invoking the method read if the caller uses StaticImport.

Good names for static import:

Not so good:

On the other hand, if the combination of the class name and method name proves more meaningful, suggest that callers not statically import that particular method.


Loading...