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);  } } To store text data To represent a point with x and y coordinates To create a graphical shape To perform mathematical calculations

 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);  } } private protected default public

 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);  } } protected private public default

 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);  } } To display a message on the console To get the x-coordinate of a point To set the x-coordinate of a point To calculate the sum of two numbers

 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);  } } To set the y-coordinate of a point To read input from the user To calculate the product of two numbers To get the y-coordinate of a point

 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);  } } Point None of the these Both Point and Driver Driver

 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);  } } To terminate the program To perform mathematical operations To print the x and y coordinates of a point To create an instance of the Point class

 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);  } } Point Driver P p

 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);  } } setXCoordinateValue(2) setXCoordinate(2) setX(2) setXCoord(2)

 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);  } } setYCoord(3) setY(3) setYCoordinateValue(3) setYCoordinate(3)