Defining Setters- Assigning Values to Attributes
1)What is the purpose of the Point class?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

2)What are the access modifiers used for the x and y variables in the Point class?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

3)What are the access modifiers used for the setX() and setY() methods in the Point class?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

4)What is the purpose of the setX() method?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

5)What is the purpose of the setY() method?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

6)In which class is the main() method located?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

7)What is the purpose of the main() method?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

8)What is the name of the object created in the main() method?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

9)Which method is used to set the x-coordinate to 2?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}
  

10)Which method is used to set the y-coordinate to 3?
public class Point{
 private int x;
 private int y;
 private void setX(int xCoord) {
  this.x = xCoord;
 }
 private void setY(int yCoord) {
  this.y = yCoord;
 }
}
public class Driver {
 public static void main(String[]){
  Point P = new Point();
  p.setX(2);
  p.setY(3);
 }
}