Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package shapes;
- public class Shape {
- private static int x;
- private static int y;
- public Shape() {
- x=100;
- y=100;
- }
- public Shape(int x, int y) {
- this.x=x;
- this.y=y;
- }
- public void Shape(int x, int y) {
- this.x=x;
- this.y=y;
- }
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- public String printLocation() {
- return "X="+x+"/n"+
- "Y= "+ y;
- }
- public String printThis() {
- return "This is a shape";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement