पैरामीटराइज्ड कंस्ट्रक्टर को कितने तरीकों से कॉल किया जा सकता है?
Answers
Answered by
1
Answer:
The constructors can be called explicitly or implicitly. The method of calling the constructor implicitly is also called the shorthand method. If we want to initialize fields of the class with your own values, then use a parameterized constructor. Example e = Example(0, 50); // Explicit call. {{SEE THE EXPLANATION BOYS}}
Explanation:
Constructor chaining can be done in two ways: Within same class: It can be done using this() keyword for constructors in same class. From base class: by using super() keyword to call constructor from the base class.
Similar questions
English,
5 months ago
History,
5 months ago
Math,
5 months ago
Social Sciences,
11 months ago
Economy,
11 months ago
Chemistry,
1 year ago
Social Sciences,
1 year ago