how do u initialize the constant variables
Answer Posted / keshav.gadde
class sam
{
const int x;
public:
sam(int i):x(i)
{
cout<<i<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
sam s(10);
return 0;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the difference between inheritance and polymorphism?
Why do we use inheritance?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What is protected in oop?
What are the two different types of polymorphism?
• What are the desirable attributes for memory managment?
Why do we use oop?
What is inheritance write a program to show use of inheritance?
Can a varargs method be overloaded?
What is oops with example?
What is multilevel inheritance explain with example?
Why do while loop is used?
Can we have inheritance without polymorphism?
2. Give the different notations for the class.\
Can main method override?