Returning From a Method : Defining Method « Class Definition « Java Tutorial






public class MainClass {
  private int aField;

  public void aMethod() {

  }
  public double volume() {
    return 50;
  }
  
}








5.3.Defining Method
5.3.1.Methods
5.3.2.Passing Objects to a Method
5.3.3.Returning From a Method