Question: please help 8. Consider the following Point class: public class Point { public int x; public int y; public static final Point FIXED = new

 please help 8. Consider the following Point class: public class Point

please help

8. Consider the following Point class: public class Point \{ public int x; public int y; public static final Point FIXED = new Point (10,12); public Point(int xVal, int yVal){ x=xVal; y=yVal; \} public Point diff(Point other) \{ return new Point (x other. x,y other.y y; \} a. What would the following code fragment print? (Circle answer.) [4] b. Consider a program in which the following method is the only part of the program that mentions Point objects. \begin{tabular}{|lll} \hline public static void pointPlay ()\{ & \\ Point p1 = new Point (2,4); & //1. \\ Point p2=p1; & /12. \\ Point p3= new Point (7,1); & //3. \\ Point p4 = p1.diff (p3); & //4. \\ System.out.println (p4.x+p1.x); & //5. \end{tabular} How many Point objects will exist when the line labeled 5 executes? (Circle answer.) 10987654321012345678910NH What will the line labeled 5 print? (Circle answer.) 9. Consider the following class: public class Ques 8\{ public static int process(int a, int b) \{ return 3a+b; public static int process(int a) \{ return (int)Math.sqrt (a); \} a. Evaluate the following expression Ques8, process (25). b. Evaluate the following expression Ques8. process (10,25). c. Evaluate the following expression Ques8. process (25, Ques8. process(9)))

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!