Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. package shapes;
  2.  
  3. public class Shape {
  4. private static int x;
  5. private static int y;
  6.  
  7. public Shape() {
  8. x=100;
  9. y=100;
  10. }
  11.  
  12. public Shape(int x, int y) {
  13. this.x=x;
  14. this.y=y;
  15. }
  16.  
  17. public void Shape(int x, int y) {
  18. this.x=x;
  19. this.y=y;
  20. }
  21.  
  22. public int getX() {
  23. return x;
  24. }
  25.  
  26. public int getY() {
  27. return y;
  28. }
  29.  
  30. public String printLocation() {
  31. return "X="+x+"/n"+
  32. "Y= "+ y;
  33. }
  34.  
  35. public String printThis() {
  36. return "This is a shape";
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement