
5 Most Asked Java Interview Questions (With Answers)
What is the difference between JDK, JRE, and JVM? Answer: JVM (Java Virtual Machine): JVM is responsible for running Java bytecode and converting it into machine code so programs can execute on any system. JRE (Java Runtime Environment): JRE provides the environment required to run Java programs. It includes JVM + libraries. JDK (Java Development Kit): JDK is used for developing Java applications. It includes JRE + development tools like compiler (javac). 👉 In short: JDK → For Development JRE → For Running Java JVM → Executes Java bytecode. What are the main OOP concepts in Java? Answer: Java is based on Object-Oriented Programming. The four main principles are: Encapsulation – Wrapping data and methods together in a class. Inheritance – One class can acquire properties of another class. Polymorphism – One method behaves differently in different situations. Abstraction – Hiding implementation details and showing only functionality. These concepts help in writing reusable, scalable, and
Continue reading on Dev.to Beginners
Opens in a new tab



