Possible Duplicate:
Is Java “pass-by-reference”?
Why does the code below print 'test' instead of throwing a NullPointerException
?
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
sb.append("test");
append(sb);
System.out.println(sb.toString());
}
public static void append(StringBuilder sb) {
sb = null;
}