Advertisements
Advertisements
प्रश्न
Differentiate between the following statements:
abc p = new abc();
abc p = new abc(5,7,9);
फरक स्पष्ट करा
उत्तर
S.No. | abc p = new abc(); | abc p = new abc(5,7,9); |
1. | As illustrated below, the statement abc p=new abc() calls the default constructor. | The statement abc p=new abc(5,7,9) calls the parameterised constructor (seen below). The numbers 5, 7, and 9 are copied to formal parameters x, y, and z, which are used for setting the class's instance variables. |
2. |
|
|
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?