Java — Command Reference
Java's most used commands — the standard for enterprise software. Each example is a complete program (public class Main). Each with an explanation and a working example.
7 categories · 21 commands
🖥️
Output
Printing to the screen and formatting.
System.out.println()System.out.printf()String.format()📦
Variables
Typed variables and constants.
Typed variablefinal (constant)var (type inference)🔢
Numbers & Math
Arithmetic and the Math class.
Arithmetic ( + - * / % )Math.sqrt / pow / max / abs✍️
String
String methods.
length()toUpperCase() / toLowerCase()substring()split() / contains()📋
Array & List
Fixed arrays and flexible ArrayList.
Array ( type[] )ArrayList🔁
Condition & Loop
Decision making and repetition.
if / elseswitchforfor-each ( : )+1🧩
Method & Class
Method definition and classes (OOP).
Method (static)class / constructor