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 technology programming languages
  1. True

  2. False

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

Overriding methods cannot be more restrictive than the methods they override. This maintains the Liskov Substitution Principle - if the parent method is public, the child must also be public (or more accessible, though 'more accessible than public' doesn't exist). Making it protected or private would break the contract.

Multiple choice technology programming languages
  1. NoClassDefFoundError

  2. ClassCastException

  3. ArthmeticException

  4. IllegalArgumentException

Reveal answer Fill a bubble to check yourself
A Correct answer