Classes & Objects


  1. What does derived class does not inherit from the base class?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The derived class inherits everything from the base class except the given things.


  1. What is meant by polymorphism?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Polymorphism is literally meant class having many forms.



  1. Which classes are called as mixin?











  1. 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.


  1. What is the use of clog?











  1. 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.



  1. 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;
    }











  1. 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.