Naming Conventions (Cont.)


Methods
  • It should start with a lowercase letter.
  • It should be a verb such as main() and println().
  • If the name contains multiple words, start it with a lowercase letter followed by an uppercase letter such as actionPerformed().

class Employee {  
  // method
  void  draw( ) {
    //  code snippet 
  } 
}
Variables
  • It should start with a lowercase letter such as id, name.
  • It should not start with the special characters like &, %, and @.
class Employee {  
  // variable
  int id;
  // code snippet  
}
Constants
  • It should be in uppercase letters such as RED and YELLOW.

public class Employee {  
  // constant  
  static final int MIN_AGE = 18;  
  // code snippet  
}



      “The best index to a person’s character is    
      how he treats people who can’t do him any good,    
      and how he treats people who can’t fight back.”    
      ― Abigail Van Buren