Home Segments Top Top Previous Next

207: Mainline

Java also allows you to define special methods, called constructors, that are called automatically whenever a new class instance is created. You can use such constructors to assign values to the instance variables in class instances, instead of supplying initializing values in variable-declaration statements.