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
-
inheritance
-
abstraction
-
polymorphism
-
encapsulation
D
Correct answer
Explanation
Encapsulation is the object-oriented programming concept that binds together the data and the functions that manipulate that data into a single unit, usually a class.
A
Correct answer
Explanation
Yes, class objects can be passed to functions either by value, by reference, or by pointer, just like primitive data types.
-
entities
-
objects
-
classes
-
none
A
Correct answer
Explanation
In layered architecture, the active elements in each layer are formally called entities. These entities perform the functions of that layer and provide services to the layer above.
-
Inheritance Data Unit
-
Interface Data Unit
-
Integrated Data Unit
-
None of these
-
predefined
-
post defined
-
abstract
-
none of these
A
Correct answer
Explanation
Primitive data types (like int, float, char) are predefined by the programming language and represent the most basic building blocks for data manipulation.
-
abstract data type
-
primitive data type
-
polymorphic
-
data type
-
set of values
-
built-in data type
-
polymorphic
-
abstract data type
B
Correct answer
Explanation
Pre-defined data types, such as int, float, or char, are provided by the programming language and are known as built-in or primitive data types.
-
polymorphism
-
inheritance
-
encapsulation
-
none of above
C
Correct answer
Explanation
Encapsulation is the bundling of data and the methods that operate on that data into a single unit, such as a class.
-
polymorphism
-
inheritance
-
encapsulation
-
none of above
A
Correct answer
Explanation
Polymorphism allows objects of different classes to be treated as objects of a common superclass, or allows methods to take different forms.
-
class
-
object
-
program
-
method
-
redefining
-
redirecting
-
reusable
-
none of above
C
Correct answer
Explanation
Objects are designed to be reusable software components, allowing the same logic or structure to be used in different parts of an application.
-
Polymorphism
-
Inheritance
-
Encapsulation
-
None of above
B
Correct answer
Explanation
Inheritance is the OOP principle that allows a new class to derive attributes and methods from an existing class.
-
basic
-
primary
-
derived
-
none of the above
C
Correct answer
Explanation
In C, data types are categorized as basic (int, char, etc.), derived (arrays, pointers, structures, unions), and user-defined. Unions are derived types.
-
classes
-
attributes
-
symbols
-
all of the above
C
Correct answer
Explanation
At the symbol level, knowledge is represented using symbols that correspond to objects, properties, and relations. These symbols are manipulated by the system to perform reasoning.
-
DES
-
DESCryptoServiceProvider
-
TripleDES
-
MACTripleDES
-
ProtectedMemory
C
Correct answer
Explanation
This .NET cryptographic class represents the super class for triple data encryption standard algorithms from which all TripleDES implementations must derive.