Skip to content

Classes & Interfaces

Marvin Hofmann edited this page Aug 22, 2016 · 5 revisions

Naming

  • Named in UpperCamelCase convention

Imports

  • If 5 or more classes from 1 package are used, convert to wildcard (package.*) import
/**/
import my.company.package.ClassA;
import my.company.package.ClassB;
import my.company.package.ClassC;
import my.company.package.ClassD;
import my.company.package.ClassE;
/**/

to

/**/
import my.company.package.*;
/**/

Static Imports

  • The only allowed static imports are those that match *Utils and enum

Flags

  • abstract assumes the class name starts with Abstract
/**/
public abstract class AbstractMyClassName
{
    // abstract class content
}
/**/
  • interface assumes the class name starts with I
/**/
public interface IMyInterfaceName
{
    // interface content
}
/**/

Braces

  • On new line
/**/
public class MyClassName
{
    // class content
}
/**/

Applies to

  • Class
  • Annotation
  • Interface