मराठी

Create a class with one integer instance. Initialize the variable using: Parameterised constructor. - Computer Applications

Advertisements
Advertisements

प्रश्न

Create a class with one integer instance. Initialize the variable using:

Parameterised constructor. 

कोड लेखन

उत्तर

class Sample 
{ 
int a; 
Sample(int n) // Parameterised constructor 
   { 
   a = n; 
   }
}
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Constructors - Review Insight [पृष्ठ ४१६]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 7 Constructors
Review Insight | Q 12. (ii) | पृष्ठ ४१६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×