多选题 What is wrong with the following code segment? (Choose all that apply.) 1: float a = 1.2f; 2: int b = 5; 3: short c = 9; 4: long d = 6; 5: double e = b; 6: Double f = e; 7: Short g; 8: Float h = g.floatValue(); A. Nothing is wrong. B. There is an error on line 1. C. There is an error on line 2. D. There is an error on line 3. E. There is an error on line 4. F. There is an error on line 5. G. There is an error on line 6. H. There is an error on line 7. I. There is an error on line 8.
【正确答案】 I
【答案解析】对象g从未被初始化。因此,当调用方法时,会导致编译时错误。A、B、C、D、E、F、G和H不正确。这些都是有效的代码行。