Explain some points related to the constructor?
There are some important points related to the constructor which mentioned below,
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
There are some important points related to the constructor which mentioned below,
- A class can have any number of constructors.
- A constructor doesn’t have any return type, not even void.
- A static constructor cannot be a parameterized constructor.
- Constructor of a class must have the same name as the class name in which it resides.
- A constructor can not be abstract, final, static and Synchronized.
- Within a class, you can create only one static constructor.
- Access modifiers can be used in constructor declaration to control its access i.e which other class can call the constructor.
need an explanation for this answer? contact us directly to get an explanation for this answer