多选题 You are writing a class that will store the status of an on/off switch. Which data type is most appropriate for storing this value?
  • A. boolean
  • B. char
  • C. short
  • D. int
【正确答案】 A
【答案解析】boolean基本数据类型用于存储true或者false,这可以用于switch语句。B、C和D不正确,它们都是用于不同数据类型的基本数据类型。