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
C
Correct answer
Explanation
There are five subclasses of OutputStream class are the. These are :-1.) FileOutputStream :- for writing bytes into file.2.) ObjectOutputStream:- for writing objects and primitive data types to output stream.3.) ByteArrayOutputStream:- For output stream that writes byte into array.4.) pipedOutputStream :- for writing into a piped stream.5.) FilterOutputStream :- for filtering output into an existing stream.So this is the correct answer.
-
four
-
three
-
two
-
one
-
none of these
C
Correct answer
Explanation
This is the correct answer. Byte stream can be defined by using two class hierarchies. These two classes are :-1.) InputStream2.) OutputStreamSo this is the correct answer.
-
Seven
-
Five
-
Two
-
Four
-
None of these
D
Correct answer
Explanation
This is the correct answer. Character stream class is defined by using two class hierarchies. These classes are:-1.) Reader class2.) Writer class
-
ObjectOutputStream
-
PipedOutputStream
-
ByteOutputStream
-
Both 1 and 2
-
All of these
D
Correct answer
Explanation
As I explained both option 1 & 2 are correct.So this is correct choice.
D
Correct answer
Explanation
There are 6 subclasses of reader Class in Java. These are :-1.) BufferedReader :- for buffering other readers.2.) ChararrayReader :- For reading from char array.3.) FilterReader :- For readin filter streams.4.) InputStreamReader :- For reading a character stream.5.) PipedReader :- for reading from pipe.6.) StringReader :- for reading from a string.So this is the correct answer.
A
Correct answer
Explanation
There are 7 subclasses of Writer class in Java. These are :-1.) OutputStreamWrite :- for writing a character stream.2.) BufferedWriter:- for buffering other writers.3.) PrintWriter :- for writing formatted data.4.) PipedWriter:- for writing to a pipe.5.) CharArrayWriter:- for writing to a char array.6.) StringWriter:- for writing to a string.7.) FilterWriter:- for writing filtered streams.So this is the correct answer.
-
DESCryptoServiceProvider
-
MD5
-
DES
-
RC2
-
ProtectedData
C
Correct answer
Explanation
It represents the base class for the data encryption standard algorithm from which all data encryption standard implementations must derive.
-
DSACryptoServiceProvider
-
DSA
-
AsymmetricSignatureFormatter
-
Rijndael
-
ProtectedMemory
B
Correct answer
Explanation
It represents the abstract base class from which all implementations of the digital signature algorithm must inherit.
-
TripleDES
-
TripleDESCryptoServiceProvider
-
DESCryptoServiceProvider
-
Rijndael
-
QueryString parameter
A
Correct answer
Explanation
It represents the base class for Triple data encryption standard algorithms from which all TripleDES implementations must derive.
-
ECDsaCng
-
DSACryptoServiceProvider
-
AsymmetricSignatureFormatter
-
ECDsa
-
ProtectedData
D
Correct answer
Explanation
It provides an abstract base class that encapsulates the elliptic curve digital signature algorithm.
-
ECDiffieHellmanCng
-
ECDiffieHellman
-
ECDsaCng
-
Rijndael
-
ProtectedData
B
Correct answer
Explanation
It provides an abstract base class that elliptic curve diffie hellman algorithm implementations can derive from.
-
CngKey
-
CryptographicAttributeObject
-
CryptographicAttributeObjectCollection
-
AesCryptoServiceProvider
-
RandomNumberGenerator
C
Correct answer
Explanation
It contains a set of CryptographicAttributeObject objects.
-
ECDiffieHellmanPublicKey
-
ECDsaCng
-
ECDiffieHellmanCng
-
CngKeyBlobFormat
-
Cryptographic signing
A
Correct answer
Explanation
It provides an abstract base class from which all elliptic curve diffie hellman cryptography next generation public key implementations must inherit.
-
CryptographicAttributeObjectEnumerator
-
CryptographicAttributeObject
-
CngKey
-
OidEnumerator
-
ProtectedData
A
Correct answer
Explanation
It provides enumeration functionality for the CryptographicAttributeObjectCollection collection.
-
CryptoAPITransform
-
CryptoStream
-
CryptographicAttributeObject
-
CngAlgorithmGroup
-
QueryString parameter
A
Correct answer
Explanation
It performs a cryptographic transformation of data.