10 basic Java interview questions with their answers
1. What is Java? Answer: Java is a high-level, object-oriented programming language developed by Sun Microsystems (now owned by Oracle). It is platform-independent due to its "Write Once, Run Anywhere" (WORA) capability achieved through the Java Virtual Machine (JVM). 2. What are the key features of Java? Answer: Object-Oriented : Everything in Java is treated as an object. Platform-Independent : Java code runs on any platform that supports JVM. Robust : Provides strong memory management and exception handling. Multithreaded : Supports concurrent execution of two or more threads. Secure : Includes security features like cryptography and runtime checks. 3. What is the difference between JDK, JRE, and JVM? Answer: JDK (Java Development Kit) : Includes tools for developing Java applications, like compilers and libraries. JRE (Java Runtime Environment) : Provides libraries and JVM to run Java applications. JVM (Java Virtual Machine) : Executes Java bytecode and ensures platform...