PPT Slide
Motivation: We need a means of initializing the attributes of a new object (or “instance”) when it is created.
Means: “Constructor methods” that are invoked automatically upon “instantiation” (creation) of new object.
public Box (int iNewLength, int
iNewWidth, int iNewHeight) {
Note: Constructor method has same identification as the class.
Box subwooferBox = new Box; subwooferBox.setLength(46); subwooferBox.setWidth(46); subwooferBox.setHeight(82);