OOPs MCQ

Below OOPs quiz are Multiple Choice Questions (MCQs) type Quiz. These OOPs MCQ Questions helps you to refresh your OOPs, you can see the correct option by clicking on it. .
  • 1. Which of the following is the correct class of the object cout?

    • Iostream
    • Istream
    • Ostream
    • Ifstream
  • 2. Which of the following term is used for a function defined inside a class?

    • Member Variable
    • Member function
    • Class function
    • Classic function
  • 3. Suppose B is a subclass of A, to invoke the __init__ method in A from B, what is the line of code you should write?

    • A.__init__(self)
    • B.__init__(self)
    • A.__init__(B)
    • B.__init__(A)
  • 4. What will be the output of the following Python code?def func(a, b=5, c=10): print('a is', a, 'and b is', b, 'and c is', c)func(3, 7)func(25, c = 24)func(c = 50, a = 100)

    • a is 7 and b is 3 and c is 10a is 25 and b is 5 and c is 24a is 5 and b is 100 and c is 50
    • a is 3 and b is 7 and c is 10a is 5 and b is 25 and c is 24a is 50 and b is 100 and c is 5
    • a is 3 and b is 7 and c is 10a is 25 and b is 5 and c is 24a is 100 and b is 5 and c is 50
    • Error
  • 5. once we compile the C++ code and the .exe is generated,we can run the program from DOS prompt

    • maybe
    • no
    • true
    • false
  • 6. What type of inheritance is illustrated in the following Python code?class A(): passclass B(): passclass C(A,B): pass

    • Multi-level inheritance
    • Multiple inheritance
    • Hierarchical inheritance
    • Single-level inheritance
  • 7. Which of the following is not a type of inheritance?

    • Double-level
    • Multi-level
    • Single-level
    • Multiple
  • 8. class is a collection of

    • objects
    • entity
    • attributes
    • all
  • 9. If class B is subclassed from class A then which is the correct syntax

    • class B:A{}
    • class B extends A{}
    • class B extends class A{}
    • class B implements A{}