The Default Constructor : Constructor « Class Definition « Java Tutorial






public class MainClass {
  double radius;

  MainClass() {

  }

  // Class constructor
  MainClass(double theRadius) {
    radius = theRadius;

  }

}








5.2.Constructor
5.2.1.Using Constructors
5.2.2.The Default Constructor
5.2.3.Multiple Constructors
5.2.4.Calling a Constructor From a Constructor
5.2.5.Duplicating Objects using a Constructor
5.2.6.Class Initializer: during declaration
5.2.7.Order of constructor calls