Classes

Constructors

Sometimes there is a constructor statement, which is initialized in the main method. The constructor is a public method that shares the name as the class.

Constructors are often used when certain variables are needed to be initialized at object creation.