MCQs > IT & Programming > OOPS Concepts MCQs > Basic OOPS Concepts MCQs

Basic OOPS Concepts MCQ

1. Which of the following statements is not correct with regard to Procedural Language?


Answer

Correct Answer: Data is emphasized over procedure

Note: This Question is unanswered, help us to find answer for this one

2. Which of the following are object oriented programming language?


Answer

Correct Answer: All of the above are object oriented programming language

Note: This Question is unanswered, help us to find answer for this one

3. Which of the following is honored as the first Object Oriented Programming language having notion of objects, classes and inheritance in it?


Answer

Correct Answer: Simula

Note: This Question is unanswered, help us to find answer for this one

4. Which of the following is the starting point for program execution in C++?


Answer

Correct Answer: main function

Note: This Question is unanswered, help us to find answer for this one

5. Inheritance is a process by which the objects of parent class acquire the properties of a child class.


Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

6. What is Abstraction?


Answer

Correct Answer: An act of representing essential features without including details or working methodology

Note: This Question is unanswered, help us to find answer for this one

7. Which of the following cannot apply to constructors?


Answer

Correct Answer: Void return type

Note: This Question is unanswered, help us to find answer for this one

8. What is Encapsulation?


Answer

Correct Answer: Wrapping functions and data into a single unit

Note: This Question is unanswered, help us to find answer for this one

9. What is an Object in Object Oriented Programming?


Answer

Correct Answer: An entity having state and behavior

Note: This Question is unanswered, help us to find answer for this one

10. The dynamic binding is the linking of a procedure call with the code to be executed at runtime.


Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

11. Which of the following is a benefit derived from using OOPS?


Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

12. Which of the following help increase the code clarity?

Answer

Correct Answer: Abstraction

Note: This Question is unanswered, help us to find answer for this one

13. Two functions are defined with the same name and same return type. The first one accepts string input parameter type and the second one accepts integer. This represents Abstraction.


Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

14. Which of the following cannot be passed to a function?


Answer

Correct Answer: Header File

Note: This Question is unanswered, help us to find answer for this one

15. You have three classes named A, B, and C. The class B is derived from class A and class C is derived from B. Which of the following relations are correct for the given classes?


Answer

Correct Answer: B is a A

Note: This Question is unanswered, help us to find answer for this one

16.
A shared/static method is associated with a Class.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

17. What does the following classes (as shown in the given figure) represent?
A --> B --> C --> D


Answer

Correct Answer: Multi-level inheritance

Note: This Question is unanswered, help us to find answer for this one

18. Which of the following types of Inheritance is not known?


Answer

Correct Answer: Ternary

Note: This Question is unanswered, help us to find answer for this one

19. Object-based programming languages do not support Inheritance and dynamic binding.


Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

20. Which of the following is not a procedural language?


Answer

Correct Answer: Small talk

Note: This Question is unanswered, help us to find answer for this one

21. Which of the following is an "Intermediate Base Class" with regard to the given figure:
Class A  --> Class B (Derived) --> Class C (Derived)


Answer

Correct Answer: Class B

Note: This Question is unanswered, help us to find answer for this one

22. In Java, how many times can classes be nested within a class?


Answer

Correct Answer: Any number of times

Note: This Question is unanswered, help us to find answer for this one

23. Function Overloading is based upon the number and/or type of arguments passed.


Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

24. How much memory does a function use up within an object?


Answer

Correct Answer: 0 byte

Note: This Question is unanswered, help us to find answer for this one

25. Is it possible to call a main() inside another main() function in C++?


Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

26. Which of the following statements are correct?


Answer

Correct Answer: A class is an instance factory

Note: This Question is unanswered, help us to find answer for this one

27. Which of the following is not correct with regard to a virtual function in C++?


Answer

Correct Answer: It implements early binding

Note: This Question is unanswered, help us to find answer for this one

28. Which of the following statements are correct with regard to Prototype based programming?


Answer

Correct Answer: It is a means of achieving object-oriented behavior sharing.

Note: This Question is unanswered, help us to find answer for this one

29. Why is composition considered a simpler method than inheritance?

Answer

Correct Answer: Composition lacks the namespace clash, and the complicated inheritance hierarchies.

Note: This Question is unanswered, help us to find answer for this one

30. What is the difference between interfaces and abstract classes?

Answer

Correct Answer: abstract classes can provide default implementation whereas interfaces cannot provide implementations

Note: This Question is unanswered, help us to find answer for this one

31. True or false? Private variables are visible outside of the class.

Answer

Correct Answer: only through methods

Note: This Question is unanswered, help us to find answer for this one

32. If a system is systematically computing “metadata”, what would you use to define that system?

Answer

Correct Answer: Attribute grammars.

Note: This Question is unanswered, help us to find answer for this one

33. What class and extension best demonstrate a HAS-A Relationship?

Answer

Correct Answer: Feline, Lion

Note: This Question is unanswered, help us to find answer for this one

34. Virtual inheritance is:

Answer

Correct Answer: where only one base class object is created

Note: This Question is unanswered, help us to find answer for this one

35. Programming languages supporting the OOPS paradigm are typically contained within what two classes?

Answer

Correct Answer: Prototype-based, or class-based.

Note: This Question is unanswered, help us to find answer for this one

36. A clone method is needed to:

Answer

Correct Answer: to create a second copy of all contained subobjects

Note: This Question is unanswered, help us to find answer for this one

37. What are classes used for?

Answer

Correct Answer: Classes are used to define specific types.

Note: This Question is unanswered, help us to find answer for this one

38. When two methods have the same name, what are they considered, and what kind of binding do they have?

Answer

Correct Answer: Overloaded, static.

Note: This Question is unanswered, help us to find answer for this one

39. Semantically, what has happened if the result rendered is non-computational?

Answer

Correct Answer: Syntactically illegal strings have occurred.

Note: This Question is unanswered, help us to find answer for this one

40. True or false? Static variables are visible outside of the class

Answer

Correct Answer: depends

Note: This Question is unanswered, help us to find answer for this one

41. An abstract class can:

Answer

Correct Answer: Be subclassed

Note: This Question is unanswered, help us to find answer for this one

42. True or false? Abstract methods are only defined in the parent.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

43. What is the most important trait of a polymorphism?

Answer

Correct Answer: The common interface.

Note: This Question is unanswered, help us to find answer for this one

44. When a variable is defined within a class, what is it considered?

Answer

Correct Answer: An instance variable.

Note: This Question is unanswered, help us to find answer for this one

45. A mutator method is also known as a:

Answer

Correct Answer: setter

Note: This Question is unanswered, help us to find answer for this one

46. Which of the following is included in the field of formal semantics?

Answer

Correct Answer: The definition of semantic models.

Note: This Question is unanswered, help us to find answer for this one

47. Lambda functions are allowed in class definitions

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

48. Which of the following could be considered a polymorphism?

Answer

Correct Answer: The class, “clsCalculation” with two functions, both named “Add”.

Note: This Question is unanswered, help us to find answer for this one

49. True or false? A class can implement one or more interfaces.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

50. Which of the following classes allows only one object of it to be created?

Answer

Correct Answer: Singleton class

Note: This Question is unanswered, help us to find answer for this one

51. If a user were to observe Java code from the outside world, what would they be able to access?

Answer

Correct Answer: The public methods.

Note: This Question is unanswered, help us to find answer for this one

52. True or false? Using traits gives single inheritance languages most of the power of multiple inheritance.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

53. True or false? An interface is another name for a class.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

54. Ref counts are:

Answer

Correct Answer: a way of managing object lifetimes

Note: This Question is unanswered, help us to find answer for this one

55. What is a primary motivation for using OOP?

Answer

Correct Answer: To increase reusability and maintainability of code.

Note: This Question is unanswered, help us to find answer for this one