Q.1

Which of the following is correct about class and structure?

  • class can have member functions while structure cannot.
  • class data members are public by default while that of structure are private.
  • Pointer to structure or classes cannot be declared.
  • class data members are private by default while that of structure are public by default.
Q.2

Which of the following operators cannot be overloaded?

  • []
  • ->
  • ?:
  • *
Q.3

Which of the following factors supports the statement that reusability is a desirable feature of a language?

  • It decreases the testing time.
  • It lowers the maintenance cost.
  • It reduces the compilation time.
  • Both A and B.
Q.4

Which of the following ways are legal to access a class data member using this pointer?

  • this->x
  • this.x
  • *this.x
  • *this-x
Q.5

Which of the following statements is correct in C++?

  • Classes cannot have data as protected members.
  • Structures can have functions as members.
  • Class members are public by default.
  • Structure members are private by default.
Q.6

Which of the following type of class allows only one object of it to be created?

  • Virtual class
  • Abstract class
  • Singleton class
  • Friend class
Q.7

Which inheritance type is used in the class given below?
class A : public X, public Y
{}

  • Multilevel inheritance
  • Multiple inheritance
  • Hybrid inheritance
  • Hierarchical Inheritance
Q.8

Which one of the following is correct about the statements given below?

  1. All function calls are resolved at compile-time in Procedure Oriented Programming.
  2. All function calls are resolved at compile-time in OOPS.
  • Only II is correct.
  • Both I and II are correct.
  • Only I is correct.
  • Both I and II are incorrect.
Q.9

What happens if the base and derived class contains definition of a function with same prototype?

  • Compiler reports an error on compilation.
  • Only base class function will get called irrespective of object.
  • Only derived class function will get called irrespective of object.
  • Base class object will call base class function and derived class object will call derived class function.
Q.10

Which of the following correctly describes overloading of functions?

  • Virtual polymorphism
  • Transient polymorphism
  • Ad-hoc polymorphism
  • Pseudo polymorphism
Q.11

Which of the following approach is adapted by C++?

  • Top-down
  • Bottom-up
  • Right-left
  • Left-right
Q.12

How many types of polymorphisms are supported by C++?

  • 1
  • 2
  • 3
  • 4
Q.13

Which of the following cannot be used with the keyword virtual?

  • class
  • member functions
  • constructor
  • destructor
Q.14

Which of the following functions are performed by a constructor?

  • Construct a new class
  • Construct a new object
  • Construct a new function
  • Initialize objects
Q.15

Which of the following statement is correct?

  • Class is an instance of object.
  • Object is an instance of a class.
  • Class is an instance of data type.
  • Object is an instance of data type.
Q.16

Which of the following concepts means wrapping up of data and functions together?

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism
Q.17

Which of the following concepts means waiting until runtime to determine which function to call?

  • Data hiding
  • Dynamic casting
  • Dynamic binding
  • Dynamic loading
Q.18

In which of the following a virtual call is resolved at the time of compilation?

  • From inside the destructor.
  • From inside the constructor.
  • From inside the main().
  • Both A and B.
Q.19

Which of the following statements regarding inline functions is correct?

  • It speeds up execution.
  • It slows down execution.
  • It increases the code size.
  • Both A and C.
Q.20

Which of the following is used to make an abstract class?

  • Declaring it abstract using static keyword.
  • Declaring it abstract using virtual keyword.
  • Making at least one member function as virtual function.
  • Making at least one member function as pure virtual function.
0 h : 0 m : 1 s