Java flashcards
The steady language behind banks, Android roots and big business servers.
What is Java, in one plain sentence?
Java is a programming language for writing programs that run the same way on Windows, Mac, Linux and servers, without rewriting them for each one.
Tap to turn over. Swipe right if you know it, left to see it again.
What you will learn
Start from zero
- What Java is and why it exists4 cards
- Key words4 cards
- Getting ready3 cards
Core basics
- Running Java2 cards
- Values and variables3 cards
- Text3 cards
- Control flow2 cards
- Classes and objects3 cards
- Collections2 cards
- Errors2 cards
Next steps
- Object-oriented design3 cards
- Pattern matching2 cards
- Generics2 cards
- Lambdas and streams3 cards
- Exceptions and resources2 cards
- Files, dates and the standard library2 cards
- Build tools and testing2 cards
- Concurrency basics2 cards
Go deeper
- The JVM inside4 cards
- Memory model and concurrency5 cards
- Performance and tooling3 cards
- Modules and modern language2 cards
- Security and production3 cards
Final test and certificate
10 questions drawn fresh from the whole topic, about 15 minutes. Sign in, score 80% or more and get a free certificate with your name and a public check link anyone can open, such as an employer or a teacher. Not signed in? Try a practice test from the cards.
Take the final testAbout these cards
- Reviewed 26 October 2026
- CoversJava 25 LTSJDK 26JUnit 5
Checked against
Java at a glance
Java is a programming language that runs the same program on almost any computer, used for large, long-lived business software.
Like a shipping container: pack your goods once, and every port, truck and ship in the world knows how to carry it.
Words you will meet
- Compiler
- The tool (
javac) that checks your code and turns it into bytecode - Bytecode
- The in-between form of your program that any JVM can run
- JVM
- The Java Virtual Machine: the program that runs bytecode on your computer
- JDK
- The Java Development Kit: the download with the compiler, the JVM and tools
- Class
- A blueprint that describes a kind of thing, like an order or a customer
- Object
- One real thing made from a class, like order number 1042
- Method
- A named set of steps that belongs to a class
- Type
- The kind of value a variable holds, like a whole number or text
The steps
- 1. Start from zero (11 cards): What Java is, where it runs and the words you need.
- 2. Core basics (17 cards): Run programs, variables, text, control flow, classes, collections and errors.
- 3. Next steps (18 cards): Interfaces, pattern matching, generics, streams, files, builds, tests and virtual threads.
- 4. Go deeper (17 cards): JVM internals, garbage collection, the memory model, performance, modules and security.
All 11 cards in Start from zero
- What is Java, in one plain sentence?
- Java is a programming language for writing programs that run the same way on Windows, Mac, Linux and servers, without rewriting them for each one.
- Why was Java made, and what problem did it fix?
- In the 1990s a program built for one kind of computer would not run on another. Java added a middle layer, the JVM, so one program could run everywhere a JVM exists.
- Where do you already meet Java in daily life?
- Bank and payment servers, airline and train booking systems, large online shops, government portals, Android's foundations and Minecraft Java Edition all run on Java.
- What everyday thing is the JVM most like?
- A universal power adapter. Your program is the plug, each computer is a different wall socket, and the JVM sits in between so the plug fits every socket.
- What happens between typing Java code and seeing it run?
- You write a
.javafile. The compiler checks it and makes bytecode. Then the JVM reads that bytecode and runs it on your computer. - What are a class and an object, using a cookie cutter?
- A class is the cookie cutter: the shape and rules. An object is one real cookie made with it. One
Orderclass can make thousands of order objects. - What is a method, in plain words?
- A named set of steps that belongs to a class, like
calculateTotalon an order. You call it by name whenever you need those steps done. - Why does Java ask what type each value is?
- So mistakes are caught early. If a box is marked to hold a whole number, Java refuses to put text in it, and tells you before the program ever runs.
- What do you need before you start, and what does it cost?
- A computer, a free JDK download (for example from the OpenJDK project), and a text editor or a free code editor. Java itself costs nothing to learn or use.
- What does your very first Java program look like now?
- Since Java 25 a tiny program can be just a main method in a file.
IO.printlnprints a line of text on the screen. - After this topic, what will you be able to do?
- Read and write real Java code, build small tools and services, understand job interview questions on Java, and move on to frameworks like Spring or to Android with Kotlin.
Java cheatsheet
Run and build
java Main.javaCompile and run one filejavac -d out $(find src -name '*.java')Compile a source treejava -cp out app.MainRun a class from compiled outputjar --create --file app.jar --main-class app.Main -C out .Package a runnable JAR./mvnw verifyMaven: compile, test, package, checks./gradlew buildGradle: compile, test, assemblejshellTry Java lines interactively
Everyday syntax
var total = 0L;Type inferred, still fixedrecord Point(int x, int y) {}Immutable data classswitch (x) { case A -> ...; default -> ...; }Arrow switch, no fall throughif (o instanceof Order ord) {}Type test and bind""" ... """Multi-line text block"%s: %.2f".formatted(name, amt)Format text with valuesfor (var item : items) {}Loop over every item
Collections and streams
List.of(a, b) / Map.of(k, v)Unmodifiable collectionsnew ArrayList<>(list)Mutable copymap.getOrDefault(k, 0)Lookup with fallbackmap.merge(k, 1, Integer::sum)Count occurrenceslist.stream().filter(p).map(f).toList()Filter, transform, collectCollectors.groupingBy(Order::city)Group into a map of listslist.getFirst() / list.reversed()Sequenced collection helpers (21+)
Errors and resources
try (var r = ...) { }Auto-close resourcescatch (IOException | SQLException e)Catch several typesObjects.requireNonNull(x, "x")Fail fast on nullOptional.ofNullable(v).orElse(d)Handle a maybe-missing valuethrow new IllegalStateException(msg)Signal a broken state
JVM and diagnostics
-Xms1g -Xmx1gStart and max heap size-XX:+UseZGCLow-pause garbage collector-Xlog:gc*Log garbage collectionjcmd <pid> Thread.printThread dumpjcmd <pid> JFR.start duration=60s filename=a.jfrRecord a profile-XX:+HeapDumpOnOutOfMemoryErrorDump heap when memory runs out