Computer Science, asked by parthprajapati598, 11 months ago

पैरामीटराइज्ड कंस्ट्रक्टर को कितने तरीकों से कॉल किया जा सकता है?

Answers

Answered by king547
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