題目?jī)?nèi)容
(請(qǐng)給出正確答案)
如下代碼定義了一個(gè)類Test:class Test {private int y;Test (int x) { y:x; }}現(xiàn)在為Test 類生成
如下代碼定義了一個(gè)類Test: class Test { private int y; Test (int x) { y:x; } }現(xiàn)在為Test 類生成一個(gè)對(duì)象,正確的語句是()。
A.Test t = new Test();
B.Test t=new Test(10, 20);
C.Test t;
D.Test t=new Test(10);
答案