Question: What is the output of the following program? public class ReferenceMystery3 { public static void main (String [] args) { int a = 7; %3D
What is the output of the following program?
![public class ReferenceMystery3 { public static void main (String [] args) { int a = 7; %3D int b = 9; Point pl new Point (2, 2); Point p2 new Point (2, 2); addToXTwice (a, pl); System.out.println (a +](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/9/7/1/2875fc86f974b8971606971288235.jpg)
public class ReferenceMystery3 { public static void main (String [] args) { int a = 7; %3D int b = 9; Point pl new Point (2, 2); Point p2 new Point (2, 2); addToXTwice (a, pl); System.out.println (a + " " + b + " " + pl.x + " " + p2.x); addToXTwice (b, p2); System.out.println (a + + b + " + pl.x + + p2.x); public static void addToXTwice (int a, Point p1) { a a + a; pl.x a; System.out.println (a + + pl.x); } %3D %3D %3D
Step by Step Solution
3.34 Rating (157 Votes )
There are 3 Steps involved in it
Output of Ref... View full answer
Get step-by-step solutions from verified subject matter experts
