class TestClass {
public static void main(String... args) {
Bean b=new Bean();
b.setA(10);
b.setB(20);
changeValue(b);
System.out.println("A "+b.getA());
System.out.println("B "+b.getB());
}
static void changeValue(Bean b)
{
b.setA(30);
b.setB(40);
b=null;
}}
Hi all, I read few questions on stackoverflow about whether java is call by value or not and then I thought of giving it a try. If using reference i can make changes in the value ...why can't i set it to null? Thanks in advance.