Skip to content
  • Introduction to Java · Java

Introduction to Java

LearnViaNotes @learnvianotes· 2 min read

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”)

FeatureWhat it means in practice
Object-orientedEverything lives inside a class; encapsulation, inheritance, polymorphism, abstraction.
SimpleNo pointers, no operator overloading, no multiple class inheritance, no header files.
RobustStrong typing, exceptions, bounds-checked arrays, GC.
SecureBytecode verification, no raw memory access, sandboxable class loaders.
MultithreadedThreads, locks and concurrent collections built into the language and library.
Architecture-neutralFixed sizes for primitives: an int is 32 bits everywhere.

Hello, World

Java
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
        System.out.println("Running on Java " + Runtime.version().feature());
    }
}
Output
Hello, Java!
Running on Java 21
Terminal
$ 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 REPL

Where 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?

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report