问题详情

答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

如下代码定义了一个类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);

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题