Call by Value and Call by Reference in Java
Java is always pass-by-value, even for objects. Understand why references behave deceptively, with clear examples of primitives, objects, and arrays.
Focused tutorials on the parts of Java that actually trip people up β how parameters are passed, what ++i versus i++ really does, where a variable lives and dies, and how to stop writing println for formatted output. Every tutorial is short, runnable, and pinned to modern Java (17 and 21).
How arguments are passed, variadic methods, accessors, and formatted output.
Java is always pass-by-value, even for objects. Understand why references behave deceptively, with clear examples of primitives, objects, and arrays.
Java varargs (the ellipsis ...) let methods accept any number of arguments. Syntax, overloading rules, @SafeVarargs and common pitfalls explained.
Java getters and setters explained: encapsulation principles, naming conventions, validation patterns, IDE generation, Lombok and records.
Use System.out.printf in Java to format strings, numbers and dates. Conversion specifiers, width/precision flags, locale and String.format equivalent.
Where variables live, how long they stay alive, and the subtle operators that bite beginners.
Variable scope in Java: local, instance, static, and block. Lifetime rules for each category with examples showing when variables exist in memory.
Java ++ and -- operators: prefix vs postfix semantics, common pitfalls, operator precedence and safe usage patterns with clear examples.
A tutorial on this site is a short, self-contained deep-dive into a single Java concept with runnable code and a clear before/after for any common mistake. They are not a sequential course β if you are looking for a guided learning path from zero, start at Learn Java instead, which walks through primitives, OOP, collections and exceptions in order.
A lot of Java tutorials on the open web date from the Java 5β8 era and never got refreshed. They still teach raw HashMap iteration with Iterator, string concatenation in a loop, anonymous inner classes where a lambda now does the job, and SimpleDateFormat that nobody should touch in 2026. Every tutorial here is written β or rewritten β against Java 17 and 21, with the legacy alternative shown only when it is still common in real codebases so you can recognise it.
We prioritise tutorials based on real search queries and reader questions. If you landed here looking for something that is not covered, send us a note β if it is a genuine knowledge gap, it gets written.