最专业的java面试题

时间:2008-03-25 15:56:49  来源:  作者:
 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;

文章评论

共有 位网友发表了评论 查看完整内容