Advertisements
Advertisements
Question
Create a class with one integer instance. Initialize the variable using:
Default constructor.
Code Writing
Solution
class Sample
{
int a;
Sample() // Default constructor
{
a = 0;
}
}
shaalaa.com
Is there an error in this question or solution?
Chapter 7: Constructors - Review Insight [Page 416]