- 21
- 0
- 约3.02万字
- 约 20页
- 2016-12-10 发布于重庆
- 举报
程序员java面试题.
1.Which of the following range of short is correct?
A. -27 -- 27-1 B. 0 – 216-1 C. 215 – 215-1 D. 231 – 231-1 翻译:下面哪些是short型的取值范围。
答案::C
解析:短整型的数据类型的长度是16 bits,有符号。另外需要说明的是java中所有的整(Integral)数包括byte,short,int,long全是有符号的。
2.Which declarations of identifiers are legal?
A. $persons B. TwoUsers C. *point D. this E. _endline 翻译:下面哪些是合法的标识符。答案:A,B,E
解析:Java的标识符可以以一个Unicode字符,下滑线(_),美元符($)开始,后续字符可以是前面的符号和数字,没有长度限制,大小写敏感,不能是保留字。
3.Which statement of assigning a long type variable to a hexadecimal value is correct?
A. long number 345L;B. long number 0345;C. long number 0345L;D.
原创力文档

文档评论(0)