Java - Introduction
Java Introduction
Java is a statically-typed, object-oriented language running on the JVM. It powers enterprise applications, Android, big data platforms, and more.
Key Concepts
- JVM: The Java Virtual Machine executes compiled bytecode.
- JRE: The Java Runtime Environment (JVM + standard libraries) to run apps.
- JDK: The Java Development Kit (JRE + compilers/tools) to build apps.
- WORA: Write Once, Run Anywhere—portable bytecode across platforms.
- LTS releases: Long-Term Support versions (e.g., 8, 11, 17, 21) are common in production.
Hello, World
Save this as Hello.java
:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Compile and run:
# compile
javac Hello.java
# run
java Hello
Typical Use Cases
- Enterprise backends (REST, microservices)
- Android applications (Kotlin and Java interop)
- Big data (Hadoop ecosystem), stream processing
- Trading systems and low-latency services
Next Steps
- Install a modern JDK and IDE/tooling.
- Learn syntax, variables, control flow.
- Dive into OOP: classes, interfaces, inheritance.
- Master collections, generics, exceptions.
- Explore lambdas, streams, and concurrency.
Tip for teachers: emphasize the compile → run loop and static typing feedback. Tip for architects: align on LTS versions and dependency management.
Try it
- Create Hello.java, compile with
javac Hello.java
, and run withjava Hello
. - Edit the message to print your name and run it again.
- Use
jshell
to evaluate40 + 2
and"Hi " + "Java"
.