Java is a general-purpose, class-based language created for portable, maintainable software. It powers Spring Boot microservices, large banking systems, Hadoop-era data tooling, and still underpins much Android history (Kotlin interoperates on the same JVM).
Core characteristics
- Static typing — types checked at compile time; fewer runtime surprises than dynamic languages
- Bytecode + JVM — source compiles to
.classfiles; the JVM JIT-compiles hot paths - Garbage collection — memory reclaimed automatically; tune GC in production, not in hello-world
- Rich standard library — collections, concurrency, I/O, networking, time API (
java.time)
Typical build-run flow
- Write
Main.javawith a public class matching the filename javac Main.javaproducesMain.classjava Mainstarts the JVM and callsmain
Important interview questions and answers
- Q: Is Java compiled or interpreted?
A: Both—javaccompiles to bytecode; the JVM interprets and JIT-compiles to native code at runtime. - Q: What is the JVM?
A: The runtime that loads bytecode, manages memory, and provides platform abstraction. - Q: Java vs JavaScript?
A: Unrelated languages despite the name—Java is statically typed and JVM-based; JavaScript is dynamic and runs in browsers/Node.
Self-check
- What file extension do Java source files use?
- Name one industry domain where Java is common.
Interview prep
- Compiled or interpreted?
Both—
javaccompiles source to bytecode; the JVM interprets and JIT-compiles hot code to native instructions at runtime.