java's argument is passed by value or by reference
i am puzzled , somebody said java only exits one passing argument rules, that is passed by value , what does that mean?
public void fn1(String a){
a="aaaa"
}
public static void main(String []args){
String b="bbb";
fun1(b);
System.out.println(b);
}
in the screen , it will show "bbb" ,why?
if passed by reference ,i think it is modified , so it should print out "aaaa"
by the way, is there a way we can get the integer value in the method whose return type is boolean?
Thank you.
|