The program below produces 4 lines of output. What are they? public class VerySimplePoint { int x; int y; public VerySim
Posted: Tue Apr 12, 2022 10:19 am
The program below produces 4 lines of output. What are they? public class VerySimplePoint { int x; int y; public VerySimplePoint() { x = 2; y = 2; } } class Mystery { public static void main(String[] args) { int a = 7; int b = 9; VerySimplePoint pl = new VerySimplePoint(); VerySimplePoint p2 = new VerySimplePoint(); addToXTwice(a,p1); System.out.println(a + + b + + p1.X + addToxTwice(b,p2); System.out.println(a + + b + + p1.x + } + p2.x); + p2.x); public static void addToXTwice(int a, VerySimplePoint p1) { a = a + a; p1.x += a; System.out.println(a + " + p1.x); } } Line 1: Line 2: Line 3: Line 4: