How do we define a constructor in symbol?

The Symbol() constructor returns a value of type symbol, but is incomplete as a constructor because it does not support the syntax ” new Symbol() ” and it is not intended to be subclassed. It may be used as the value of an extends clause of a class definition but a super call to it will cause an exception.

Read more

Why do we define a constructor?

The sole purpose of the constructor is to initialize the data fields of objects in the class . Java constructor can perform any action but specially designed to perform initializing actions, such as initializing the instance variables. A constructor within a class allows constructing the object of the class at runtime.

Read more