选择题
1:下面关于变量及其范围的陈述哪些是错的。
。
。
。
2:
What will be printed when you execute the following code?
class X
{
Y b = new Y();
X()
{
("X");
}
}
class Y
{
Y()
{
("Y");
}
}
public class Z extends X
{
Y y = new Y();
Z()
{
("Z");
}
public static void main(String[] args)
{
new Z();
}
}
Choices:
What will be printed when you execute the following code?
class X
{
Y b = new Y();
X()
{
("X");
}
}
class Y
{
Y()
{
("Y");
}
}
public class Z extends X
{
Y y = new Y();
Z()
{
("Z");
}
public static void main(String[] args)
{
new Z();
}
}
Choices:
3:
Give the code fragment:
if(x>4){
(“Test 1”);}
else if (x>9){
(“Test 2”);}
else {
(“Test 3”);}
Which range of value x would produce of output “Test 2”?
Give the code fragment:
if(x>4){
(“Test 1”);}
else if (x>9){
(“Test 2”);}
else {
(“Test 3
达内科技 JAVA 面试 笔试 来自淘豆网m.daumloan.com转载请标明出处.