1 / 4
文档名称:

Java经典笔试题01.doc

格式:doc   大小:85KB   页数:4页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

Java经典笔试题01.doc

上传人:小雄 2021/11/12 文件大小:85 KB

下载得到文件列表

Java经典笔试题01.doc

文档介绍

文档介绍:1.
Given:
1.
public class test (
2.
public static void main
(String args []) (
3.
int i 二 OxFFFFFFFl
//0001
4.
int j = ~i;//1110,
取反
5.
6.
}
7.
)
What is the decimal value of
j at line 5?
A.
0
B.
1
C.
14
D.
-15
E.
An error at line 3 causes
compilation to fail.
F.
An error at line 4 causes
compilation to fail.
Given'.
Integer i 二 new Integer (42);
Long 1 = new Long (42);
Double d = new Double (42. 0);
Which two expressions evaluate to True? (Choose Two)
(i =1)
(i = d)
(d = 1)
(i. equals (d))
(d. equals (i))
(i. equals (42))
Click the exhibit button:
public class test (
private static int j = 0;
3.
private static boolean methodB(int k)(
j += k;
return true;
)
8.
public static void methodA(int i) (
boolean b;
b = i < 10 | methodB (4) ;//非短路
b = i < 10 || methodB (8) ;//短路,后面不执行
)
14.
public static void main (String args[] } (
methodA (0);
system, out. printin (j);
)
)
What is the result?
The program prints "0"
The program prints "4''
The program prints "8"
The program prints "12"
The code does not complete
Given'.
Public class test (
Public static void main (String args[]) (
System, out. printin (6 八 3) ; //0110 " 0011 = 0101
)
)
What is the output? 5
Which statement is correctly declare a variable a which is suitable for refering to an array of
50 string empty object?(长度为50的空数组引