若有byte b=6;short s=20;则表达式b+s的值的类型是()。A.byteB.intC.shortD.char

题目

若有byte b=6;short s=20;则表达式b+s的值的类型是()。

A.byte

B.int

C.short

D.char

参考答案和解析
答案:C
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

若有定义语句:int s=6;则表达式s%2+(s+1)%2的值为 。


1

第2题:

以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s;

A.byte, short, int, long, float, double

B.boolean, byte, short, char, int, long, float, double

C.byte, short, char, int, long, float, double

D.byte, short, char

E.int, long, float, double


正确答案:E
 

第3题:

若有float f=2.6f;short s=20;则表达式f+s的值的类型是()。

A.float

B.short

C.int

D.byte


答案:A

第4题:

若有char c='8';short s=20;则表达式c+s的值的类型是()。

A.char

B.short

C.int

D.byte


答案:A

第5题:

若有byte b=6;char c='c';则表达式b+c的值的类型是()。

A.int

B.byte

C.char

D.float


答案:C

第6题:

若有int x=10;char c='d';则表达式a+c的值的类型是()。

A.char

B.int

C.float

D.byte


答案:A

第7题:

自动类型转换规定的优先次序是( )。

A.short,byte,char→long→int→float→double

B.short,byte,char→int→long―float→double

C.byte,short,char→long→int→float→double

D.byte,short,char→int→long→float→double


正确答案:D

第8题:

Java语言中数值数据的类型能自动转换,按照从左到右的转换次序为()。

A.byte→int→short→long→float→double

B.byte→short→int→long→float→double

C.byte→short→int→float→long→double

D.short→byte→int→long→float→double


正确答案:B

第9题:

switch语句中的表达式的值只能是int、byte、short和______型的值。


正确答案:char
char