> can you pass by refrence in Java?
nope ...
java passes primatives by value and objects
by reference copy ...
> java is passing a pointer (er, "reference").
> ... yes, it is passing the value of
no it doesn't - it passes a copied object's reference.
otherwise code like this:
Code:
void a(Object obj){
obj = null;
}
void b(){
Object o = new Object();
a(o);
if(null == a){
System.out.println("not possible");
}
}
would print "not possible". - it wont.