1. What is Java and its features?

Java is a high-level, object-oriented, platform-independent programming language developed by Sun Microsystems (now Oracle). It is widely used for desktop, web, and mobile applications.

Key Features:

Summary: Java is a secure, platform-independent, object-oriented language suitable for various applications.

2. Difference between JDK, JRE, and JVM

Component Definition Purpose
JVM (Java Virtual Machine) Virtual machine that executes Java bytecode. Runs Java programs.
JRE (Java Runtime Environment) Contains JVM + core libraries. Allows running Java programs.
JDK (Java Development Kit) Contains JRE + development tools like javac. Used for developing and running Java programs.

Summary: JDK is for development, JRE is for running, and JVM executes bytecode.

3. Explain JVM memory areas (Heap, Stack, Method Area)

JVM divides memory into several areas for execution and object management:

  1. Heap:
  2. Stack: