public class xy
{
public static void main(String args[])
{
point p1=new point();
p1.show();
point p2=new point(3.5,4.5);
p2.show();
}
}
class point
{
double x,y;
public point ()
{
}
public point (double x,double y)
{
x=0;
y=0;//这里是0
}
public double a()
{
return x+y;
}
public void show()//这里是void 不然要返回值才行
{
System.out.println("两数之和"+a());
}//下面的两个花括号改成英文输入法
}