What is the value of myBox.size
after calling updateBox
?
class Box {
int size;
Box(int size) {
this.size = size;
}
}
public class Test {
public static void main(String[] args) {
Box myBox = new Box(5);
updateBox(myBox);
System.out.println(myBox.size);
}
static void updateBox(Box b) {
b.size = 10;
}
}