Constructors

suggest change

Introduction

A class does not have to declare a constructor. If it declares none, and it is not an interface, the compiler supplies a default constructor. A constructor initializes a new instance. It is not a method. This topic demonstrates how to use constructors.

Remarks

The Java Language Specification talks at length about the exact nature of constructor semantics. They can be found in JLS ยง8.8

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents