Practice · 4 of 4
Master MCQ
CHALLENGE
Difficulty: advanced+25 XP
What is printed?
``java
public class Box {
private int v;
public Box(int v) { this.v = v; }
public void add(int n) { v += n; }
public String toString() { return "" + v; }
}
Box one = new Box(10);
Box two = one;
two.add(5);
one = new Box(1);
one.add(1);
System.out.print(one + "/" + two);
`
A. 2/15
B. 15/2
C. 2/2
D. 15/15`
Print the letter, then your one-sentence justification.
Press Submit to check your solution.
Back to lesson: Practice: Master simulation: MCQ section