Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public class Point {
  2.  
  3. private int m_x;
  4. private int m_y;
  5.  
  6. public Point(int x, int y){
  7. this.m_x=x;
  8. this.m_y=y;
  9.  
  10.  
  11. }
  12. public Point(){
  13. //this.m_x=0;
  14. //this.m_x=0;
  15. this(0,0);
  16.  
  17. }
  18. public int getX(){
  19. return this.m_x;
  20. }
  21. public int getY(){
  22. return this.m_y;
  23. }
  24. public void setX(int x){
  25. this.m_x=x
  26. }
  27. public void setY(int y){
  28. this.m_y=y
  29. }
  30. public static void main (String[] args){
  31. Point a= new Point(1,1)
  32.  
  33. }
  34.  
  35. }
  36.  
  37. Point a= new Point(1,1)
  38. print(a.getX())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement