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

  2. 6

  3. 5

  4. 8

  5. 7

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. four

  2. three

  3. two

  4. one

  5. none of these

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. 9

  2. 8

  3. 7

  4. 6

  5. 5

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. 7

  2. 6

  3. 8

  4. 9

  5. 5

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. ECDiffieHellmanPublicKey

  2. ECDsaCng

  3. ECDiffieHellmanCng

  4. CngKeyBlobFormat

  5. Cryptographic signing

Reveal answer Fill a bubble to check yourself
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.