HSCS.146 Aliasing and Object Mutation
0%
Skill Level🔴 Hard
00:00
Progress to Next Level25% to Medium
EasyMediumHardMastery100%
A drawing app saves undo states with saved.add(current), not by copying current.
Drawing current = new Drawing();
ArrayList saved = new ArrayList();
saved.add(current);
current.addShape("line");
current.addShape("oval");
System.out.println(saved.get(0).size());
What is printed?
