A method that returns the value of a property is named getXxx(), where xxx is the property name. : JavaBeans « Object Oriented « SCJP






public class MainClass {
  private int iValue = 0;

  public int getIValue() {
    return iValue;
  }

  public static void main(String[] argv) {
    System.out.println();
  }
}








6.10.JavaBeans
6.10.1.JavaBeans Naming Convention
6.10.2.A method that returns the value of a property is named getXxx(), where xxx is the property name.
6.10.3.A method that modifies the value of a property is named setXxx(), where xxx is the property name.