As anybody knows, java passes variables by value. and i haven't found the magic compiler switch to change that. of course, there are problems caused by this restriction, but in most cases, pass-by-value works just fine. 

If you end up in a situation where it'd come in handy to have a pass-by-reference facility, think about the way java is storing objects, and how these objects are then passed-by-value. 

First of all, an object variable contains only a ( typed ) memory address. Thus, comparing e.g. two strings for equality will yield only true if they are in fact the same strings, same applies for all other types. And this is the value. So in fact you pass a ( kind of ) pointer to a function, enabling to manipulate the original object, as the object is not cloned or something else.

Its also common to encapsulate basic types like int into a object just for the sake of manipulating it in some methods.

So let's break it down to a simple example:

class MInt {
	int x;

public void inc(MInt what){

This will result in the int x of a MInt object being indeed incremented. Let's imagine calling a increase method with a plain integer. This will change just nothing, at least not outside the methods scope.