设有泛型类的定义如下 class Test { } 则由该类创建对象时,使用正确的是?
举一反三
- 设有泛型类的定义如下class Test; { }则由该类创建对象时,使用正确的是? A: Test; x = new Test;(); B: Test x = new Test(); C: Test; x = new Test;(); D: Test; x = new Test;();
- 设有泛型类的定义如下class Test<T> { }则由该类创建对象时,使用正确的是? A: Test x = new Test();<table width="77" cellspacing="0" cellpadding="0"><colgroup><tbody><tr class="firstRow">数据添加到文件中; B: Test<int> x = new Test<int>(); C: Test<Object> x = new Test<Object>(); D: Test<T> x = new Test<T>();
- 给出如下类定义:public class test {test(int k) { }}如果要创建一个该类的对象,正确的语句是:
- 中国大学MOOC: 给出如下类定义: public class Test { Test(int i) { } } 如果要创建一个该类的对象,正确的语句是( )。
- 给出如下类定义: public class Test { Test(int i) { } } 如果要创建一个该类的对象,正确的语句是( )。 A: Test t = newTest(); B: Test t = newTest(5); C: Test t = newTest("5"); D: Test t = newTest(3.4);