Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Point {
- private int m_x;
- private int m_y;
- public Point(int x, int y){
- this.m_x=x;
- this.m_y=y;
- }
- public Point(){
- //this.m_x=0;
- //this.m_x=0;
- this(0,0);
- }
- public int getX(){
- return this.m_x;
- }
- public int getY(){
- return this.m_y;
- }
- public void setX(int x){
- this.m_x=x
- }
- public void setY(int y){
- this.m_y=y
- }
- public static void main (String[] args){
- Point a= new Point(1,1)
- }
- }
- Point a= new Point(1,1)
- print(a.getX())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement