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. AesCryptoServiceProvider

  2. AesManaged

  3. Aes

  4. ProtectedData

  5. AsnEncodedDataEnumerator

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

This encryption-decryption class of .Net technology represents the abstract base class from which all implementations of the advanced encryption standard must inherit.

Multiple choice
  1. AsymmetricKeyExchangeDeformatter

  2. AsymmetricSignatureFormatter

  3. AsnEncodedData

  4. AsymmetricKeyExchangeFormatter

  5. ProtectedData

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

This encryption-decryption class of .Net technology represents the base class from which all asymmetric key exchange formatters derive.

Multiple choice
  1. DES

  2. DESCryptoServiceProvider

  3. DSA

  4. ProtectedData

  5. CngKey

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

This encryption-decryption class of .Net technology represents the base class for the data encryption standard algorithm from which all data encryption standard implementations must derive.

Multiple choice
  1. CryptographicAttributeObjectCollection

  2. CryptoConfig

  3. ProtectedMemory

  4. CryptographicAttributeObjectEnumerator

  5. AsnEncodedDataEnumerator

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

This encryption-decryption class of .Net technology provides enumeration functionality for the CryptographicAttributeObjectCollection collection.

Multiple choice
  1. public

  2. private

  3. protected

  4. none of these

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

In C++ inheritance, a protected member inherited in public mode remains protected in the derived class. Public inheritance maintains the access level - public members stay public, protected members stay protected, and private members remain inaccessible (though they exist in the derived class). This preserves encapsulation while allowing controlled access in the inheritance hierarchy.

Multiple choice
  1. outside the class definition

  2. inside the class definition

  3. both inside & outside the class definition

  4. none of the above

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

C++ allows member functions to be defined either inside the class definition (implicitly inline) or outside the class using the scope resolution operator (::). Defining inside is convenient for short functions, while defining outside keeps the class interface clean. Both approaches are valid and commonly used depending on function complexity and coding style preferences.

Multiple choice
  1. Linker combines the object files into a single executable program.

  2. Linker converts the source file into object file.

  3. Linker converts the source file into executable file.

  4. None of the above

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

A linker combines multiple object files (compiled from source code) into a single executable program. It resolves references between modules and performs address binding. Compilers create object files, while linkers create the final executable.