</>

Technology

Core Java

Difficulty

Beginner

Interview Question

What is Java and what are its key features?

Answer

What is Java?

Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. It was developed by James Gosling at Sun Microsystems in 1995.

Key Features of Java

1. Platform Independent — "Write Once, Run Anywhere (WORA)"

Java code compiles to bytecode (.class files), not machine code. The JVM (Java Virtual Machine) on any OS can run the same bytecode.

CODE
Java Code (.java)
      ↓  javac compiler
  Bytecode (.class)
      ↓  JVM
Runs on Windows / Linux / Mac

2. Object-Oriented

Everything in Java is an object. Supports: Inheritance, Encapsulation, Polymorphism, Abstraction.

3. Strongly Typed

Every variable must have a declared type. Type mismatch = compile-time error.

4. Automatic Memory Management

The Garbage Collector (GC) automatically frees unused objects — no manual memory management like C/C++.

5. Multithreading

Java has built-in support for concurrent programming via Thread class and Runnable interface.

6. Robust and Secure

  • Compile-time and runtime error checking
  • No pointer arithmetic (prevents memory corruption)
  • Built-in exception handling

7. Rich Standard Library

Java provides a vast API: Collections, I/O, Networking, Concurrency, JDBC, and more.

JDK vs JRE vs JVM

ComponentFull FormPurpose
JDKJava Development KitFor developers — includes compiler (javac), JRE, debugging tools
JREJava Runtime EnvironmentFor running Java apps — includes JVM + libraries
JVMJava Virtual MachineExecutes bytecode on the specific OS
CODE
JDK ⊃ JRE ⊃ JVM

Why Java for QA/SDET?

  • Selenium WebDriver is written in Java
  • TestNG, JUnit, Rest Assured, Cucumber all use Java
  • Most enterprise automation frameworks are Java-based
  • Strong type system catches bugs at compile time, not runtime

Follow AutomateQA

Related Topics