编写一个类用于存储on/off开关的状态,下面( )数据类型最适合存储该值。
A: boolean
B: char
C: short
D: int
A: boolean
B: char
C: short
D: int
举一反三
- 5,'5',"5"分别适合哪种数据类型来存储。 A: byte,char,boolean B: int,String,char C: short,char,String D: long,boolean,char
- 【填空题】在 Java 中, 基本数据类型有: byte 、 short 、 int 、 long 、 float 、 double 、 char 、 boolean。其中, byte 类型数据占 ______ 个字节, short 类型数据占 ______ 个字节, int 类型数据占 ______ 个字节, long 类型数据占 ______ 个字节,float 类型数据占 ______ 个字节,double 类型数据占 ______ 个字节, char 类型数据占 ______ 个字节, boolean 类型数据占 ______ 个字节
- 只能存储 true与false值的基本数据类型是? A: int B: double C: boolean D: char
- 对于“switch(a)”表达式中的变量a,它可以被声明为哪些合法数据类型? A: boolean, byte, char, short, int, long B: boolean, byte, char, short, int C: byte, char, short, int D: boolean, byte, char, short, int, long, float, double
- Java语言中,数据类型( ) 的存储位数与boolean类型一样多。 A: yte B: short C: int D: 不确定