基本語法--流程控制語句

1、 switch 當需要對選項進行等值判斷時,使用 switch語句。 switch case 語句有如下規則: • switch 語句中的變量類型可以是: byte、short、int 或者 char。從 Java SE 7 開始,switch 支持字符串 String 類型了,同時 case 標籤必須爲字符串常量或字面量。 • switch 語句可以擁有多個 case 語句。每個 case
相關文章
相關標籤/搜索