常見Java面試題(一)

前段時間準備面試時,遇到的一些常問問題總結   1.Switch 語句能否作用於byte,long,String?    byte可以,long,String不可以,因爲switch 的判斷條件可以接受int,byte,char,short,不接受其他類型   2.給出輸出結果   int testNum = 1;   switch(testNum ){   case 1:   System.ou
相關文章
相關標籤/搜索