• ( 1 ) What is object in C++ ?

    • 1) Object is part of syntax of a class.
    • 2) Object is datatype of a class.
    • 3) Object is an instance of a class.
    • 4) Object is function of a class.
    • Discussion in forum
      Answer : 3) Object is an instance of a class.
      Solution :








      discussion


      Answer : 3) Object is an instance of a class.

    • ( 2 ) Which of the following cannot be passed to a function?

    • 1) Reference variable
    • 2) Arrays
    • 3) Class objects
    • 4) Header files
    • Discussion in forum
      Answer : 4) Header files
      Solution :








      discussion


      Answer : 4) Header files

    • ( 3 ) The fields in the class in c++ program are by default

    • 1) protected
    • 2) private
    • 3) public
    • 4) None of these
    • Discussion in forum
      Answer : 2) private
      Solution :








      discussion


      Answer : 2) private

    • ( 4 ) How to access the object in the class?

    • 1) scope resolution operator
    • 2) ternary operator
    • 3) direct member access operator
    • 4) None of these
    • Discussion in forum
      Answer : 3) direct member access operator
      Solution : Objects in the method can be accessed using direct member access operator which is (.).








      discussion


      Answer : 3) direct member access operator

    • ( 5 ) Classes in c++ are ?

    • 1) Fundamental data type
    • 2) Primitive data type
    • 3) Desired data type
    • 4) Not defined
    • Discussion in forum
      Answer : 3) Desired data type
      Solution :








      discussion


      Answer : 3) Desired data type

    • ( 6 ) What is meant by containership?

    • 1) class contains objects of other class types as its members
    • 2) class contains objects of other class types as its objects
    • 3) Both 1 & 2
    • 4) None of these
    • Discussion in forum
      Answer : 1) class contains objects of other class types as its members
      Solution :








      discussion


      Answer : 1) class contains objects of other class types as its members

    • ( 7 ) Which Class allow primitive type to be accessed as object?

    • 1) Storage
    • 2) virtual
    • 3) Friend
    • 4) Wrapper
    • Discussion in forum
      Answer : 2) virtual
      Solution :








      discussion


      Answer : 2) virtual

    • ( 8 ) How do we declare an 'interface' class?

    • 1) By making all the methods pure virtual in a c;ass
    • 2) By making all the methods abstract using the keyword 'abstract' in a class
    • 3) By declaring all the class as interface with the keyworf 'interface'
    • 4) It is not possible to create interface class in C++
    • Discussion in forum
      Answer : 1) By making all the methods pure virtual in a c;ass
      Solution :








      discussion


      Answer : 1) By making all the methods pure virtual in a c;ass

    • ( 9 ) Pick out the correct statement about override.

    • 1) Overriding refers to a derived class function that has the same name and signature as a base class virtual function.
    • 2) Overriding has different names.
    • 3) Both 1 & 2
    • 4) None of these
    • Discussion in forum
      Answer : 1) Overriding refers to a derived class function that has the same name and signature as a base class virtual function.
      Solution :








      discussion


      Answer : 1) Overriding refers to a derived class function that has the same name and signature as a base class virtual function.

    • ( 10 ) The signature of function is

    • 1) The number & type of arguments
    • 2) The return type of a function
    • 3) The class definition
    • 4) None of these
    • Discussion in forum
      Answer : 1) The number & type of arguments
      Solution :








      discussion


      Answer : 1) The number & type of arguments





Top