Bookmark this page! This Java Quick Reference Cheat Sheet is an indispensable one-stop reference covering primitive specifications, all 50+ reserved keywords, operator precedence, collection time complexity, and essential JVM command-line flags.
| Type | Bits (Bytes) | Range | Default Value | Wrapper Class |
|---|---|---|---|---|
byte | 8 (1 B) | -128 to 127 | 0 | Byte |
short | 16 (2 B) | -32,768 to 32,767 | 0 | Short |
int | 32 (4 B) | -2,147,483,648 to 2,147,483,647 | 0 | Integer |
long | 64 (8 B) | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | 0L | Long |
float | 32 (4 B) | $\approx \pm 3.40282347 \times 10^{38}$ | 0.0f | Float |
double | 64 (8 B) | $\approx \pm 1.79769313486231570 \times 10^{308}$ | 0.0d | Double |
char | 16 (2 B) | '\u0000' (0) to '\uffff' (65,535) | '\u0000' | Character |
boolean | JVM Dependent | true or false | false | Boolean |
| Category | Keywords |
|---|---|
| Primitive Types | byte, short, int, long, float, double, char, boolean, void |
| Control Flow | if, else, switch, case, default, while, do, for, break, continue, return |
| Access Modifiers | public, protected, private |
| Class / Interface / Package | class, interface, enum, extends, implements, package, import, new |
| Modifiers & Qualifiers | static, final, abstract, synchronized, volatile, transient, native, strictfp |
| Exception Handling | try, catch, finally, throw, throws, assert |
| Contextual / Modern | var, record, sealed, permits, yield |
| Reserved / Unused | goto, const |
| Literals (Reserved) | true, false, null, this, super, instanceof |
| Precedence | Operator Type | Operators | Associativity |
|---|---|---|---|
| 1 (Highest) | Postfix | expr++ expr-- | Left to Right |
| 2 | Unary | ++expr --expr +expr -expr ~ ! | Right to Left |
| 3 | Multiplicative | * / % | Left to Right |
| 4 | Additive | + - | Left to Right |
| 5 | Bitwise Shift | << >> >>> | Left to Right |
| 6 | Relational | < > <= >= instanceof | Left to Right |
| 7 | Equality | == != | Left to Right |
| 8 | Bitwise AND | & | Left to Right |
| 9 | Bitwise XOR / OR | ^ followed by | | Left to Right |
| 10 | Logical AND / OR | && followed by || | Left to Right |
| 11 | Ternary | ? : | Right to Left |
| 12 (Lowest) | Assignment | = += -= *= /= %= &= | Right to Left |
| Collection | Get / Lookup | Add (Append) | Insert / Delete | Null Allowed? |
|---|---|---|---|---|
ArrayList | $O(1)$ | $O(1)$ amortized | $O(n)$ | Yes |
LinkedList | $O(n)$ | $O(1)$ | $O(1)$ (with iterator) | Yes |
HashSet | $O(1)$ | $O(1)$ | $O(1)$ | Yes (1 null) |
TreeSet | $O(\log n)$ | $O(\log n)$ | $O(\log n)$ | No |
HashMap | $O(1)$ | $O(1)$ | $O(1)$ | Yes (1 key, any values) |
TreeMap | $O(\log n)$ | $O(\log n)$ | $O(\log n)$ | No keys, yes values |
ConcurrentHashMap | $O(1)$ | $O(1)$ | $O(1)$ | No (throws NPE) |
# Memory Sizing
java -Xms2g -Xmx4g -Xss512k -XX:MetaspaceSize=256m MyApp
# Choose Modern Low-Latency Garbage Collector
java -XX:+UseG1GC -XX:MaxGCPauseMillis=200 MyApp
java -XX:+UseZGC -XX:+ZGenerational MyApp
# Diagnostic Heap Dumps on Crash
java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/dumps/ MyApp
# JVM Information & Performance
java -XshowSettings:vm -version
Congratulations! You have completed the comprehensive Veewom 80-Class Java Master Curriculum covering everything from first principles and basic syntax to high-performance JVM internals, NIO.2, virtual threads, and enterprise design patterns. Review the 120+ interview questions and practice drills before your technical assessments.
Accelerate your Java mastery by studying these tightly connected core tutorials:
Categorized Java interview and viva questions.
Detailed primitive and wrapper specifications.
Comprehensive guide to collections classes.
Functional stream operations and pipelines.