Question: Answer in Java, please explain answer as well. 3) Consider the following class: public class Abc ! private static int x; private int y ;
Answer in Java, please explain answer as well.

3) Consider the following class: public class Abc ! private static int x; private int y ; public void setX(int x) { x = x;} public void setY(int num) { y = num; } public String toString() { return " X = " + x + "ItY = "+y;} public int getProduct() { return x * y ;} } Abc a; a.y = 5; a.x = 1; System.out.println("Product = " + a.y * a.x); System.out.println("Object A= "+ a); a. What are the class variables? b. What are the instance variables? C. Identify the errors, fixed them or remove them and then print the output from the following code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
