Title: (Optional) Explain cases when constructors are called in a class hierarchy.
Course: Java Programming (Oracle) (10055) > Section: Using Inheritance

Explanation should include the following:

- Java decides which constructor is to be used based on the parameters that are supplied at the time it is called.
- If no parameters are supplied, then the default, no-argument constructor is used.
- If an integer is supplied in the calling code, the second constructor is used.

The code below would cause the second constructor to be called to create an object of type Stacking:

class DoSomeStacking{
public static void main(String args[]){
Stacking myStack = new Stacking(3);
//Java selects the constructor that requires an integer to execute
//and creates the object with an array called items that can hold 3 elements
}