A statically typed, object-oriented, garbage-collected language that compiles to bytecode and runs on any machine with a JVM — “write once, run anywhere”.
Why Java?
Key features (the classic “buzzwords”)
| Feature | What it means in practice |
|---|---|
| Object-oriented | Everything lives inside a class; encapsulation, inheritance, polymorphism, abstraction. |
| Simple | No pointers, no operator overloading, no multiple class inheritance, no header files. |
| Robust | Strong typing, exceptions, bounds-checked arrays, GC. |
| Secure | Bytecode verification, no raw memory access, sandboxable class loaders. |
| Multithreaded | Threads, locks and concurrent collections built into the language and library. |
| Architecture-neutral | Fixed sizes for primitives: an int is 32 bits everywhere. |
Hello, World
public class Main {
public static void main(String[] args) {
System.out.println("Hello, Java!");
System.out.println("Running on Java " + Runtime.version().feature());
}
}Hello, Java!
Running on Java 21$ javac Main.java # compile → Main.class (bytecode)
$ java Main # run the class on the JVM
$ java Main.java # Java 11+: compile in memory and run in one step
$ jshell # Java 9+: interactive REPLWhere Java is used
Enterprise back ends (Spring Boot) · Android (with Kotlin) · Big data (Hadoop, Spark, Kafka) · Banking & trading systems · Search (Elasticsearch, Solr) · Build tools (Maven, Gradle) · Games (Minecraft)
Why is Java called platform independent?
Is Java a purely object-oriented language?
Is Java compiled or interpreted?