मराठी

State the difference between constructor and method. - Computer Applications

Advertisements
Advertisements

प्रश्न

State the difference between constructor and method. 

Give differences between a constructor and a method.

फरक स्पष्ट करा

उत्तर

S. No. Constructor Function/Method
1. The constructor is named the same as the class name. A function's name differs from its class name.
2. Constructors do not return any value, including void. Functions may or may not return a value.
3. Constructors are often public. A method can be public or private.
4. The constructor is simply used to set data members. A method is utilized to execute mathematical or logical tasks.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Constructors - EXERCISES [पृष्ठ ४१८]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 7 Constructors
EXERCISES | Q V. 6. | पृष्ठ ४१८
अविचल Computer Applications [English] Class 10 ICSE
पाठ 7 Constructors
Review Insight | Q 8. | पृष्ठ ४१५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×