C and Java passes everything by value, there is no other way. That is also the default for C++, but it has extra notation for passing arguments as references.
Passing something by value means that a new variable is created and it is internal to the method/function:
// C/C++, Java
void something(int x){
x=10;
// printf/cout/System.out.println x here, and it will be 10
}
void usesSomething(){
int y=5;
// printf/cout/System.out.println y here, and it will be 5
something(y);
// printf/cout/System.out.println y here, and it will be 5, x was just a copy
}
And Java objects are not different:
void something(String x){
x=new String("something");
System.out.println("In something: "+x);
}
void usesSomething(){
String y=new String("Hello!");
System.out.println(y); // "Hello!"
something(y);
System.out.println(y); // again "Hello!", x was just a copy
}
The confusing part is the wording only, as the variables themselves are called "object references" in Java (they would be "pointers" in C/C++). But they (the object references) are passed by value, nothing happens to y in this code.
Passing something by reference means that doing anything with the reference will directly affect the original variable.
// C++ only
void something(int &x){
x=10;
}
void usesSomething(){
int y=5;
std::cout << y << std::endl; // it is 5
something(y);
std::cout << y << std::endl; // it is 10, x was the same variable as y
}
One thing which may be worth mentioning is that an object and a variable are never the same thing in Java. Objects reside on the heap (like the deliberately exaggerated "Hello!" and "something"), while the reference variables to these objects (x and y) can reside anywhere (here they reside on the stack), and they have their own memory for storing the reference to these objects (in C/C++ it would be very much like a pointer, which also has a size, something like 4-8 bytes).
So in the general case this is how object can 'feel' being passed by reference: you actually pass the object reference by value, ending up referring the same object. If the object is mutable (Strings are not), changes will be visible from the outside, via any other variable referring the same object. But the reference variable itself is your own, if you change it (and refer to a different object, perhaps null), no one else will notice.