class Welcome1 — every app needs at least one classpublic static void main(String[] args) — the entry point the JVM calls firstSystem.out.println(...) — prints text + moves to a new lineWelcome1.java;print() — no newline afterprintln() — newline afterprintf() — formatted output with placeholders| Op | Meaning |
|---|---|
+ - * | add, subtract, multiply |
/ | division (int / int = int) |
% | remainder (modulus) |
Precedence: () → * / % → + -, left-to-right.
| Operator | Meaning |
|---|---|
== | equal to |
!= | not equal to |
> < | greater / less than |
>= <= | greater/less than or equal |
String name = "Java";length() — number of characterstoUpperCase()/toLowerCase()charAt(i) — character at indexequals() — compare content| Method | Returns |
|---|---|
length() | number of characters |
charAt(i) | char at index i |
substring(a,b) | substring from a to b-1 |
toUpperCase()/toLowerCase() | new cased String |
equals(obj) | true if content matches |
trim() | String with whitespace removed from ends |
| Method | Returns |
|---|---|
nextInt() | next token as int |
nextDouble() | next token as double |
next() | next token as String |
nextLine() | rest of the current line as String |
hasNextInt() | true if next token is an int |