Java Keywords List: Reserved and Contextual Keywords (Java 25)
The full list of Java keywords as of Java 25, with 51 reserved and 17 contextual keywords grouped by category, literals, version history and rules.
The full list of Java keywords as of Java 25, with 51 reserved and 17 contextual keywords grouped by category, literals, version history and rules.
Learn how the Python continue statement skips a loop iteration, avoid the infinite while loop trap, and compare continue with break and pass in examples.
Learn the Java yield keyword with switch expression examples, arrow and colon cases, yield vs return vs break, exhaustiveness and contextual keyword rules.
Learn this and super in Java, this() vs super() constructor calls, Interface.super, Java 25 flexible constructor bodies and static context rules.
Learn what the strictfp keyword in Java did before Java 17, why JEP 306 made it obsolete, its syntax rules, and how to remove it from old code.
Learn the difference between final, finally and finalize in Java, with examples, when finally does not run, and what replaces deprecated finalize().
Learn the Java synchronized keyword with methods and blocks, which lock each form uses, reentrancy, visibility, deadlocks and virtual threads.
Learn the Java boolean type, default values, short-circuit operators, the Boolean wrapper, parseBoolean vs getBoolean, and boolean memory size.
Learn the Java assert keyword, enabling assertions with -ea, AssertionError, when to use assert vs exceptions, side effects, and assertions in tests.
Learn the abstract class in Java with examples, abstract methods, illegal modifier combinations, abstract class vs interface, and sealed hierarchies.
Learn the static keyword in Java for variables, methods, blocks, nested classes and imports, method hiding, thread safety and instance main in Java 25.
Learn the Java continue statement in for, while and do-while loops, guard clauses, the while loop trap, switch, forEach lambdas and labeled continue.
Learn the Java break statement in for, while and do-while loops and switch, how to exit nested loops, compile errors, finally and stream alternatives.
Learn the Java do while loop with examples, the trailing semicolon, input validation, the continue trap, compareAndSet retries and do-while vs while.
Learn the Java while loop with examples for reading input, iterators and queues, infinite loops, while vs for vs do-while, and a payment retry example.
Learn the Java for-each loop over arrays, lists, sets and maps, why the loop variable is a copy, safe removal, custom Iterable classes and reverse order.
Learn the Java for loop with its execution order, counting down, steps, two variables, nested loops, batches and the mistakes that cause wrong results.
Learn the Java if-else statement with else-if chains, nested if, the dangling else, instanceof patterns, guard clauses and ternary alternatives.
Learn the Java transient keyword with serialization examples, restoring fields in readObject(), static and final transient fields, Jackson, Gson and JPA.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.