【正文】
三、 JAVA 基礎(chǔ)題 【 45 分】 1. 下列選項中不屬于 java關(guān)鍵字的有 ( ) 【 1分】 [A] TRUE [B] sizeof [C] const [D] super [E] void 2. 下面哪些是合法的標(biāo)識符 ( ) 【 1分】 [A] $persons [B] TwoUsers [C] *point [D] this [E] _endline 3. 下列選項中不是 原始數(shù)據(jù)類型 的有 ? ( ) 【 1分】 [A]. short [B]. Boolean [C]. Unit [D]. float 4. 下列選項中那些語句片段會發(fā)生異常 【 1分】 [A] String s = Gone with the wind。 String t = good 。 String k = s + t。 [B] String s = Gone with the wind。 String t。 t = s[3] + one。 [C] String s = Gone with the wind。 String standard = ()。 [D] String s = home directory。 String t = s directory。 5. 以下選項中,合法的賦值語句是 ( )【 1分】 A. a == 1。 B. ++i。 C. a = a + 1 = 5。 D. y = (int)I。 6. 以下選項中, 代碼執(zhí)行完畢后 輸出結(jié)果 是 ( )【 1分】 boolean bool = true。 if(bool = false) { (“a”)。 JAVA 軟件工程師筆試試題 } else if (bool) { (“b”)。 } else if (!bool) { (“c”)。 } else { (“d”)。 } A. a B. b C. c D. d E. Compilation fails 7. 以下選項中, 正確 的是 ( )【 1分】 public class Alpha1 { public static void main( String[] args ) { boolean flag。 int i=0。 do { flag = false。 ( i++ )。 flag = i 10。 continue。 } while ( (flag)? true:false )。 } } A. 000000000 B. 0123456789 C. Compilation fails. D. The code runs with no output. E. The code enters an infinite loop. F. An exception is thrown at runtime. JAVA