Computer Knowledge

Object-Oriented Programming

2,686 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. Dynamic Binding

  2. Dynamic Allocation

  3. Static Typing

  4. Static Allocation

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

Polymorphism allows objects to be treated as instances of their parent class, with the specific method implementation determined at runtime through dynamic binding.

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

_______ are the object class which allows the designer to create an appropriate user interface to formally interact with the back end database, defined by the tables and queries.

  1. Forms

  2. Reports

  3. Pages

  4. Macros

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

Forms provide the user interface in a database, allowing users to interact with the underlying data in tables and queries in a structured and user-friendly way.

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

______ object class is used to create various reports, the source of information content of which is based on tables, queries or both.

  1. Forms

  2. Reports

  3. Pages

  4. Queries

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

Reports object class is used to create various reports, the source of information content of which is based on tables, queries or both. Such reports are designed in access according to the requirement of end-user.