Java Quick Reference & Developer Cheat Sheet

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.

1. Java Primitive Data Types Matrix

TypeBits (Bytes)RangeDefault ValueWrapper Class
byte8 (1 B)-128 to 1270Byte
short16 (2 B)-32,768 to 32,7670Short
int32 (4 B)-2,147,483,648 to 2,147,483,6470Integer
long64 (8 B)-9,223,372,036,854,775,808 to 9,223,372,036,854,775,8070LLong
float32 (4 B)$\approx \pm 3.40282347 \times 10^{38}$0.0fFloat
double64 (8 B)$\approx \pm 1.79769313486231570 \times 10^{308}$0.0dDouble
char16 (2 B)'\u0000' (0) to '\uffff' (65,535)'\u0000'Character
booleanJVM Dependenttrue or falsefalseBoolean

2. All 50+ Java Reserved Keywords

CategoryKeywords
Primitive Typesbyte, short, int, long, float, double, char, boolean, void
Control Flowif, else, switch, case, default, while, do, for, break, continue, return
Access Modifierspublic, protected, private
Class / Interface / Packageclass, interface, enum, extends, implements, package, import, new
Modifiers & Qualifiersstatic, final, abstract, synchronized, volatile, transient, native, strictfp
Exception Handlingtry, catch, finally, throw, throws, assert
Contextual / Modernvar, record, sealed, permits, yield
Reserved / Unusedgoto, const
Literals (Reserved)true, false, null, this, super, instanceof

3. Operator Precedence & Associativity

PrecedenceOperator TypeOperatorsAssociativity
1 (Highest)Postfixexpr++ expr--Left to Right
2Unary++expr --expr +expr -expr ~ !Right to Left
3Multiplicative* / %Left to Right
4Additive+ -Left to Right
5Bitwise Shift<< >> >>>Left to Right
6Relational< > <= >= instanceofLeft to Right
7Equality== !=Left to Right
8Bitwise AND&Left to Right
9Bitwise XOR / OR^ followed by |Left to Right
10Logical AND / OR&& followed by ||Left to Right
11Ternary? :Right to Left
12 (Lowest)Assignment= += -= *= /= %= &=Right to Left

4. Collections Time Complexity Matrix (Big-O)

CollectionGet / LookupAdd (Append)Insert / DeleteNull 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)

5. Essential JVM Runtime Command Flags

# 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
Curriculum Completion Milestone

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.

Frequently Asked Questions (FAQ)

Q1. How many reserved keywords exist in modern Java?
There are currently 53 reserved keywords in Java (including const and goto which are reserved but unused, and true, false, and null which are reserved literals). Recent contextual keywords include var, record, sealed, permits, and yield.
Q2. Which Java operator has the highest precedence?
Postfix operators like expr++ and expr-- followed by unary prefix operators (++expr, --expr, +, -, ~, !) have the highest precedence, right behind parenthesized expressions (parentheses () always evaluate first).
Q3. What is the default initial capacity and load factor of a Java HashMap?
The default initial capacity is 16 buckets, and the default load factor is 0.75. When 75% of capacity is reached (12 elements), the map automatically doubles its bucket array size to 32 and rehashes existing entries.

Explore Related Java Tutorials

Accelerate your Java mastery by studying these tightly connected core tutorials:

120+ Interview Questions →

Categorized Java interview and viva questions.

Data Types Reference →

Detailed primitive and wrapper specifications.

Collections Framework →

Comprehensive guide to collections classes.

Java Stream API →

Functional stream operations and pipelines.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!