Question: Java programming please provide explanation. If we execute this main() method, write the output of the program. public void tricky (Point argl, Point arg2) {

 Java programming please provide explanation. If we execute this main() method,

Java programming

please provide explanation.

If we execute this main() method, write the output of the program. public void tricky (Point argl, Point arg2) { arg1.x = 100; arg1.y = 100; Point temp = argi; arg1 = arg2; arg2 temp; } public static void main(String [] args) { Point pnt1 new Point(0,0); Point pnt2 new Point(0,0); System.out.println("X: " + pnt1.x + Y: +pnt1.y); System.out.println("X: + pnt2.X + +pnt2.y); System.out.println(" "); tricky (pnti, pnt2); System.out.println("X: + pnt1.x + Y:" + pnt1.y); System.out.println("X: + pnt2.x " +pnt2.y); = 11 "Y: 11 11 11 11 "Y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!