Computer Knowledge

Object-Oriented Programming

2,239 Questions

Object-oriented programming questions test core computer science concepts like classes, inheritance, polymorphism, and encapsulation. The focus includes Java program structures, method overloading, and memory allocation for objects. This topic is essential for technical sections in various recruitment tests.

Java class definitionsMethod overriding rulesPolymorphism conceptsGeneric type parametersMemory allocation in objects

Object-Oriented Programming Questions

Multiple choice
  1. Type Checking

  2. Polymorphism

  3. Multithreading

  4. Encapsulation

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Multithreading is a feature of concurrent programming, not a core principle of Object-Oriented Programming (which includes encapsulation, inheritance, and polymorphism).

Multiple choice
  1. The data and methods for the class

  2. The methods and messages for the class

  3. Only the data for the class

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Inheritance allows a subclass to acquire the properties (data) and behaviors (methods) of a parent class. This promotes code reuse and hierarchical organization.

Multiple choice
  1. organize data.

  2. pass arguments to objects of classes

  3. add features to existing classes without rewriting them

  4. improve data-hiding and encapsulation

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Inheritance is a fundamental OOP concept used to extend existing classes. It allows developers to create new classes that reuse and build upon the functionality of existing ones without modifying the original source code.

Multiple choice
  1. An object can be a class

  2. A class can be an object

  3. A class must have at least one member function.

  4. If a constructor is not specified, a default constr. is used

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In Java, if a class does not explicitly define any constructors, the compiler automatically provides a default, no-argument constructor. The other options are incorrect because classes and objects are distinct entities, and classes are not required to have member functions.

Multiple choice accountancy accounting software - tally concept of entity and relationship designing and creating simple tables, forms, and queries objective in dbms

Every component that is created using access is a subject and several such similar objects constitute a class.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

MS access is one of the popularly used Database Management System (DBMS) to create, store and manage database. Every component that is created using access is an object and several such similar objects constitute a class. Access is functionally available with the seven object classes.

Multiple choice
  1. Final

  2. Concrete

  3. Abstract

  4. Polymorphic

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Abstract classes in Java are incomplete and cannot be instantiated directly using the 'new' keyword.