16. Given the following code: public class Test{ static long a[] = new long[10]; public static void main ( String arg[] ) { System.out.println ( a[6] ); } } Which statement is true? 下面關於long數組的代碼運行結果是什麼? |
|
備選答案: | A : Output is null. B : Output is 0. C : When compile, some error will occur. D : When running, some error will occur. |
你的回答: | D |
回答結果: | 錯 |
答案: | B |
答案詳解: | 類一級的屬性會被自動初始化。 主類型中數字默認爲0,boolen默認爲false 對象則默認爲null. |