1 Crore+ students have signed up on EduRev. Have you? Download the App |
It is possible to define a class within a class termed as nested class. There are _____ types of nested classes.
Which of the following, in C++, is inherited in a derived class from base class ?
What is the difference between struct and class in C++?
What is the output of the program?
class Test {
int x;
};
int main()
{
Test t;
cout << t.x;
return 0;
}
Which interface decides determines how your class will be used by other program?
Assume that an integer and a pointer each takes 4 bytes. Also, assume that there is no alignment in objects. Predict the output following program.
#include<iostream>
using namespace std;
class Test
{
static int x;
int *ptr;
int y;
};
int main()
{
Test t;
cout << sizeof(t) << " ";
cout << sizeof(Test *);
}
How many ways of reusing are there in class hierarchy?
A member function can always access the data in __________ , (in C++).
What will happen when introduce the interface of classes in a run-time polymorphic hierarchy?
Which of the following is not correct (in C++) ?
1. Class templates and function templates are instantiated in the same way
2. Class templates differ from function templates in the way they are initiated
3. Class template is initiated by defining an object using the template argument
4. Class templates are generally used for storage classes
Which operator is used to create the user-defined streams in c++?
When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass _____ the method in the superclass.