📊 Object Oriented Programming (OOP)
Q. Empty parentheses following a function name in a function prototype indicate that the function does not require any parameters to perform its task.
  • (A) true
  • (B) false
  • (C) ---
  • (D) ---
💬 Discuss
✅ Correct Answer: (A) true
📊 Object Oriented Programming (OOP)
Q. C++ programmers concentrate on creating , which contain data members and the member functions that manipulate those data members and provide services to clients.
  • (A) structures
  • (B) classes
  • (C) objects
  • (D) function
💬 Discuss
✅ Correct Answer: (B) classes
📊 Object Oriented Programming (OOP)
Q. Which of the following is FALSE about references in C++
  • (A) a reference must be initialized when declared
  • (B) once a reference is created, it cannot be later made to reference another object; it cannot be reset
  • (C) references cannot be null
  • (D) references cannot refer to constant value
💬 Discuss
✅ Correct Answer: (D) references cannot refer to constant value
📊 Object Oriented Programming (OOP)
Q. What will be the output of following program?
#include <iostream> using namespace std;
class Test{
public:
Test() { cout <<"Hello from Test() "; }
} a;
int main()
{
cout <<"Main Started "; return 0;
}
  • (A) main started
  • (B) main started hello from test()
  • (C) hello from test() main started
  • (D) compiler error: global objects are not allowed
💬 Discuss
✅ Correct Answer: (C) hello from test() main started
📊 Object Oriented Programming (OOP)
Q. Which of the following is true about constructors.
They cannot be virtual.
 They cannot be private.
They are automatically called by new operator
  • (A) all 1, 2, and 3
  • (B) only 1 and 3
  • (C) only 1 and 2
  • (D) only 2 and 3
💬 Discuss
✅ Correct Answer: (B) only 1 and 3
📊 Object Oriented Programming (OOP)
Q. Which of the following operators are overloaded by default by the compiler?
1) Comparison Operator ( == )
2) Assignment Operator ( = )
  • (A) both 1 and 2
  • (B) only 1
  • (C) only 2
  • (D) none of the two
💬 Discuss
✅ Correct Answer: (C) only 2
📊 Object Oriented Programming (OOP)
Q. Which of the following is true about inline functions and macros.
  • (A) inline functions do type checking for parameters, macros don't
  • (B) macros cannot have return statement, inline functions can
  • (C) macros are processed by pre-processor and inline functions are processed in later stages of compilation.
  • (D) all of the above
💬 Discuss
✅ Correct Answer: (D) all of the above
📊 Object Oriented Programming (OOP)
Q. In C++, const qualifier can be applied to
Member functions of a class
Function arguments
To a class data member which is declared as static
Reference variables
  • (A) only 1, 2 and 3
  • (B) only 1, 2 and 4
  • (C) all
  • (D) only 1, 3 and 4
💬 Discuss
✅ Correct Answer: (C) all
📊 Object Oriented Programming (OOP)
Q. Which of the following statements is false?
  • (A) every c++ program must have a main().
  • (B) in c++, white spaces and carriage returns are ignored by the compiler.
  • (C) c++ statements terminate with semicolon.
  • (D) main() terminates with semicolon.
💬 Discuss
✅ Correct Answer: (D) main() terminates with semicolon.

Jump to