Java
One of the most widely used languages in business software, running on the Java Virtual Machine: its types and syntax, objects, records and collections, streams and exceptions, concurrency, how projects are built and tested, and what operations people need to know to run Java applications.
20 pages 118 glossary terms OCP Java SE 25
How to use this topic
The first eight pages cover the basics: what Java and the JVM are, the JDK and your first program, types and operators, strings, control flow, loops, methods, and arrays and collections. The next seven are about designing with types: classes, records, enums and sealed types, inheritance and interfaces, null and Optional, exceptions, generics, and lambdas and streams. The last five show Java in real work: files and JSON, concurrency, packages and build tools, testing, and running Java in production.
Every example is a complete program that runs with
java Main.java on Java 25 and shows its exact output.
General programming ideas are explained in
Programming Concepts; where
Java differs from Python, JavaScript or C#, the pages say so.
The language pages are tagged OCP Java SE 25: they cover material of Oracle Certified Professional: Java SE 25 Developer, a professional-level exam rather than a beginner certificate.
Learning path
- 01What Is Java?What Java is and where it runs: the Java Virtual Machine, bytecode, the JDK and JRE, OpenJDK builds and licenses, and the six-monthly release cycle with long-term support versions.
- 02The JDK, javac, java and Your First ProgramInstalling a JDK, compiling with javac and running with java, launching a single source file directly, compact source files with void main(), reading input and trying code in JShell.
- 03Variables, Types and OperatorsJava's static types: primitive types versus objects, var, literals and conversions, integer division and overflow, floating-point surprises and BigDecimal for money.
- 04Strings and TextWorking with text in Java: immutable strings, comparing with equals instead of ==, common String methods, StringBuilder, text blocks and formatting numbers and dates.
- 05Control Flow and Switch ExpressionsMaking decisions in Java: if and else, the conditional operator, the classic switch statement and modern switch expressions with arrows and pattern matching.
- 06Loops and IterationRepeating work in Java: for, enhanced for, while and do-while loops, break and continue with labels, and iterating safely over collections.
- 07Methods and ParametersWriting methods in Java: parameters and return values, why Java always passes by value, overloading, varargs, static methods and recursion.
- 08Arrays and CollectionsStoring groups of values: arrays, the List, Set and Map interfaces with ArrayList, HashSet and HashMap, immutable List.of and Map.of, sorting and sequenced collections.
- 09Classes and ObjectsDefining your own types in Java: fields, constructors, methods, this, encapsulation with access modifiers, getters, static members, and equals, hashCode and toString.
- 10Records, Enums and Sealed TypesJava's compact data types: records for immutable data, enums for fixed sets of values, sealed classes and interfaces, and record patterns in switch.
- 11Inheritance, Interfaces and PolymorphismBuilding type hierarchies in Java: extends and super, overriding with @Override, abstract classes, interfaces with default methods, and polymorphism through dynamic dispatch.
- 12Null, Optional and NullPointerExceptionWhy null causes so many Java bugs, how to read a helpful NullPointerException message, defensive checks with Objects, and when Optional makes absence explicit.
- 13Exceptions and Error HandlingHandling errors in Java: try, catch and finally, checked versus unchecked exceptions, throws, try-with-resources, custom exceptions and reading a stack trace.
- 14GenericsType-safe containers and methods in Java: type parameters, generic classes and methods, bounded types, wildcards, and what type erasure means in practice.
- 15Lambdas, Functional Interfaces and StreamsFunctional style in Java: lambda expressions, method references, functional interfaces such as Function and Predicate, and the Stream API for filtering, mapping, grouping and collecting.
- 16Files, I/O and JSONReading and writing files with java.nio.file, paths, charsets and try-with-resources, dates and times with java.time, calling web APIs with HttpClient, and handling JSON with a library.
- 17Concurrency: Threads, Executors and Virtual ThreadsDoing several things at once in Java: threads, executors and futures, virtual threads, shared state and synchronization, and the concurrent collections.
- 18Packages, Modules and Build ToolsOrganizing and building Java projects: packages and imports, the classpath and JAR files, the module system, and building with Maven and Gradle and their dependency management.
- 19Testing and Code QualityKeeping Java code correct: unit tests with JUnit, assertions and parameterized tests, test doubles, formatting and static analysis, and compiler warnings.
- 20Running Java in ProductionWhat operations people need to know about Java applications: the heap and garbage collection, JVM options such as -Xmx, logs, thread dumps with jcmd and jstack, and common failures such as OutOfMemoryError.
Java glossary
Short definitions of the terms used in this topic. The full glossary covers every topic.