Skip to main content
OpenJDK

Must-know Java interview questions

3 reported frequent at Accenture, Deloitte, Infosys and 1 more. “Reported” because the company tags have no public source. Every quick answer is free.

Questions on this page
3
Must know
0
picked by the editor
Reported frequent
3
company tags, reported
Companies
4
with a frequent tag

Reported frequent· 3

Tagged as frequent at a company. Reported: the tags have no public source.

  1. What are the four pillars of OOP and how does Java implement each?Encapsulation hides data behind access modifiers and getters and setters. Inheritance reuses code by extends and implements. Polymorphism uses method overriding (dynamic dispatch) and overloading. Abstraction uses abstract classes and interfaces. These are the four OOP (object-oriented programming) pillars of Java.BeginnerFreeReported frequent at Infosys+1
  2. What is the difference between an abstract class and an interface?An abstract class is a partially implemented class you extends (single inheritance); it can have constructors, instance fields and any access modifiers. An interface is a contract you implements (many allowed): fields are implicitly public static final, and since Java 8 it can have default and static methods.IntermediateFreeReported frequent at Deloitte
  3. What is the difference between method overloading and method overriding?Overloading means several methods in one class share a name but have different parameters; the compiler picks one (compile-time polymorphism). Overriding means a subclass replaces a superclass method with the same signature; the JVM picks it at runtime (runtime polymorphism, dynamic dispatch).IntermediateFreeReported frequent at Accenture

Reported frequent at

Must-know questions for other tools