package com.hanqi.test;

public class Point {
private double x,y;

public double getX() {
	return x;
}

public void setX(double x) {
	this.x = x;
}

public Point(double x,double y)
{
	this.x=x;
	this.y=y;
	System.out.println("x="+x+";y="+y);
}

}
//主类
package com.hanqi.test;

public class A {

public static void main(String[] args) {
	
	Point b=new Point(5, 15);
	b.setX(10);
	System.out.println(b.getX());

}

}
//运行结果

x=5.0;y=15.0
10.0

相关文章:

  • 2021-10-09
  • 2022-12-23
  • 2021-04-12
  • 2021-06-10
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案