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
-
Class
-
Array
-
Object
-
Encapsulation
-
Delegate
E
Correct answer
Explanation
These are reference types that encapsulate a method with a specific signature.
-
SHA1CryptoServiceProvider
-
SHA512
-
SHA512Cng
-
SHA512CryptoServiceProvider
-
ProtectedMemory
D
Correct answer
Explanation
It defines a wrapper object to access the CSP implementation of the SHA512 algorithm.
-
Encapsulation
-
Inheritance
-
Polymorphism
-
Object
-
Array
C
Correct answer
Explanation
It is the quality that allows one interface access a general class of actions.
-
SHA256
-
SHA256Managed
-
SHA512
-
SHA256CryptoServiceProvider
-
Oid
D
Correct answer
Explanation
It defines a wrapper objects to access the CSP implementation of the SHA256 algorithm.
-
AsnEncodedData
-
AsnEncodedDataCollection
-
AsnEncodedDataEnumerator
-
Aes
-
RandomNumberGenerator
A
Correct answer
Explanation
This .NET cryptographic class represents abstract syntax notation one - encoded data.
-
AsymmetricSignatureDeformatter
-
AsymmetricSignatureFormatter
-
DSASignatureFormatter
-
AsymmetricKeyExchangeFormatter
-
RandomNumberGenerator
B
Correct answer
Explanation
This .NET cryptographic class represents the abstract the base class from which all implementations of asymmetric signature formatters derive.
-
AsymmetricKeyExchangeFormatter
-
CngKey
-
AsymmetricSignatureDeformatter
-
AsymmetricKeyExchangeDeformatter
-
ProtectedMemory
D
Correct answer
Explanation
This .NET cryptographic class represents the abstract base class from which all asymmetric key exchange deformatters derive.
-
CngAlgorithm
-
CngKey
-
CngAlgorithmGroup
-
AsymmetricSignatureDeformatter
-
ProtectedMemory
C
Correct answer
Explanation
This .NET cryptographic class encapsulates the name of an encryption algorithm collection.
-
Application system reuse
-
Module reuse
-
Function reuse
-
Sub-system reuse
-
Object reuse
C
Correct answer
Explanation
This is one of the software reuse methods in which software components which implement a single function is reused.
-
object
-
system
-
string
-
integer
A
Correct answer
Explanation
In Java, every class directly or indirectly extends the Object class. Object is the root of the class hierarchy. System, String, and Integer are all classes that themselves extend Object.
-
RuntimeException
-
Exception
-
Errors
-
ArithmeticException
B
Correct answer
Explanation
Constructors are NOT inherited in Java - each class must define its own constructors. A child class can CALL the parent constructor using super(), but it does not inherit it. The child class must have its own constructor, even if it only calls super().
-
employee.super();
-
super();
-
manager.super();
-
no method will require
B
Correct answer
Explanation
To invoke a parent class constructor from a child class constructor, use super() as the first statement. Option A (employee.super()) and C (manager.super()) are invalid syntax. The super() keyword alone calls the parent constructor - it's a language keyword, not a method on any object.
-
final
-
static
-
both (1) and (2)
-
none of the above
B
Correct answer
Explanation
Static variables are created when the class is loaded and persist as long as the class remains loaded. They're shared across all instances. Final variables are constants but can be instance or static. Only static has the class-lifetime behavior described in the question.
-
CryptographicAttributeObjectCollection
-
CryptoConfig
-
CngKeyBlobFormat
-
ProtectedMemory
-
CryptographicAttributeObject
E
Correct answer
Explanation
This .NET cryptographic class contains a type an a collection of values associated with that type.