class Point
{
int x,y;
Point(int a,int b)//带参数构造方法
{
x=a;
y=b;
}
Point()//不带参数构造方法
{
this.(1,1); //编译完提示我这里需要标志符咋回事? 而且结果不是1 和1 是3和3,汗,3和3那个值我注释掉了啊
}
void output()
{
System.out.println(x);
System.out.println(y);
}
void output(int x,int y)
{
x=x;
y=y;
}
/* void output(int a,int b)
{
x=a;
y=b;
} */
/* void output(int x, int y)
{
this.x=x;
this.y=y;
} */
public static void main(String args[])
{
Point pt;
pt=new Point();
// pt=new Point(3,3);
// pt.output(5,5);
pt.output();
}
}
提示我
我运行了,没别的问题,不过类要public吧