Question: In Java: Write a class named Point that has two private integer variables named x and y. Write simple getter methods (named getX, and getY)
In Java: Write a class named Point that has two private integer variables named x and y. Write simple getter methods (named getX, and getY) for each private variable that returns the value stored in the corresponding private variable. Write simple setter methods (named setX and setY) for each private variable that just takes an int argument and stores the argument value in the corresponding private variable. Do not add any other code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
