Your example for Pass by Reference section is wrong because the second println will print 10, not 20.
In Java we always pass values, never references, at least not in the same sense as in languages like C++ or C#.
In Java there are 2 kinds of values: primitive values and reference values.
When you pass an object as an argument, you are passing a reference value.
And changing the value of a reference type variable inside a method does not change the value of the variable outside.
But changing the state of a reference is not the same thing as changing the value of a variable.