Question: [ IN JAVA ] 2. What is the output of the program? 3. At the end of main, are p1 and p2 aliased? Why or
[ IN JAVA ]
2. What is the output of the program? 3. At the end of main, are p1 and p2 aliased? Why or why not?
public static void main(String[] args) { |
Rectangle box1 = new Rectangle(2, 4, 7, 9); Point p1 = findCenter(box1); printPoint(p1); box1.grow(1, 1); Point p2 = findCenter(box1); |
printPoint(p2); } |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
