a constructor is a special type of_____
Answers
The parameterized constructors are the constructors having a specific number of arguments to be passed. The purpose of a parameterized constructor is to assign user-wanted specific values to the ins.tance variables of different objects. A parameterized constructor is written explicitly by a programmer.
Answer:
A constructor is a special type of Method.
Explanation:
A class's special function Object() { [native code] } method is used to create and initialize an object instance of that class. A special kind of method called a function Object() { [native code] } is used to set up instance variables in a class. The constructor's sole function is to initialize the data fields of class objects. When a class is declared, a special initialization function known as a function Object() { [native code] } is launched.
- There are no defined data types for the argument list or return type, and the function Object() { [native code] } always has the same name as the class.
- A function Object() { [native code] } is typically used to initialize a class.