Consider the following java code.
public class A {
public static void main (String [] args){
Temp p = new Temp();
p.name = "Name";
new A().changeValue(p);
System.out.print(p.name);
}
public void changeValue(Temp t){
t.name ="changeValue";
}
}
class Temp{
String name;
}
Well I got confused about this line : new A().changeValue(p);
this is the first time for me to see like this line! is this anonymous object or?? also what is the output please! please explain with steps .
thank you