In this chapter, you will learn:
What constructors are and how to use them
Different types of initializers of a class
Declaring final variables, classes, and methods
What generic classes are and how to use them
What Is a Constructor?
A constructor is a named block of code that is used to initialize an object of a class immediately after the object is created. The structure of a constructor looks similar to a method. However, the similarity between the two stops right there, in their looks. They are two different constructs and they are used for different purposes.