Java Practice It | Self-Check 8.25 setXYPoint | classes, encapsulation, fields

preview_player
Показать описание
More practice its:

Problem:

Question:
Add methods named setX and setY to the Point class. Each method accepts an integer parameter and changes the Point object's x- or y-coordinate to be the value passed, respectively.

Your code is being added to the following class:

public class Point {
int x;
int y;

// // your code goes here

}
Рекомендации по теме