Feedback for subjective question
Question 1:
public: class class2{
public: class2(){
cout << "Calling default constructor of class2 " ;
}
};
class1(){
cout << "Calling default constructor of class1 " ;
}
};
main(){
class1::class2 obj1;
class1 obj2;
}
Consider the following code segment. What will be the output of the following code segment?
class class1{public: class class2{
public: class2(){
cout << "Calling default constructor of class2 " ;
}
};
class1(){
cout << "Calling default constructor of class1 " ;
}
};
main(){
class1::class2 obj1;
class1 obj2;
}
Current Answer:
Be the first to post an answer to earn 100CR.