Classes & Objects
- What does derived class does not inherit from the base class?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The derived class inherits everything from the base class except the given things.
- What is meant by polymorphism?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Polymorphism is literally meant class having many forms.
- Which classes are called as mixin?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
A class that expresses functionality rather than its primary design role is called a mixin.
- What is the use of clog?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
clog is an object of class ostream that represents the standard logging stream. It is associated with the cstdio stream stderr, like cerr.
- What is the output of this program?
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
stringstream strstream(ios :: in | ios :: out);
std :: string data("The double value is : 12.25 .");
strstream.str(data);
strstream.seekg(-5, ios :: end);
double value;
strstream >> value;
value = value*value;
strstream.seekp(-5,ios::end);
strstream << value;
std :: string new_value = strstream.str();
cout << new_value;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
In this program, We have used the string hierarchy to compute the square of the number.