日期:2014-05-20 浏览次数:20707 次
public class Test_2
{
public static void main(String[] args)
{
A aa = A();
A bb = A(0, 0);
}
}
class A
{
private int a;
private int b;
public A()
{
a = 10;
b = 20;
}
public A(int a, int b)
{
this.a = a;
this.b = b;
}
}
这样构造两个函数不行吗?
public static void main(String[] args){
A aa = new A();
A bb = new A(0, 0);
}