如下代码定义了一个类Test:class Test {private int y;Test (int x) { y:x; }}现在为Test 类生成
如下代码定义了一个类Test: class Test { private int y; Test (int x) { y:x; } }现在为Test 类生成一个对象,正确的语句是()。
A.Test t = new Test();
B.Test t=new Test(10, 20);
C.Test t;
D.Test t=new Test(10);
请帮忙给出正确答案和分析,谢谢!