When is the Float object, created in line 3,eligible for garbage collection?
public class X{
public Object m(){
Object o = new Float(3.14F);//line 3
Object [] oa = new Object[1];//line 4
oa[0] = o;//line 5
o=null;//line 6
return oa[0];//line 7
}
}
When is the Float object, created in line 3,eligible for garbage collection?
A.just after line 5.
B.just after line 6
C.just after line 7(that is,as the method returns)
D.never in this method
12:
What will happen when you attempt to compile and run the following code?
public class Static
{
static
{
int x = 5;
}
static int x,y;
public static void main(String args[])
{
x--;
myMethod();
System.out.println(x + y + ++x);
}
public static void myMethod()
{
y = x++ + ++x;
}
}
Choices:
What will happen when you attempt to compile and run the following code?
public class Static
{
static
{
int x = 5;
}
static int x,y;
public static void main(String args[])
{
x--;
myMethod();
System.out.println(x + y + ++x);
}
public static void myMethod()
{
y = x++ + ++x;
}
}
Choices:
A.prints : 2
B.prints : 3
C.prints : 7
D.prints : 8
13:假定a和b为int型变量,则执行下述语句组后,b的值为
a=1;
b=10;
do
{
b-=a;
a++;
} while (b--<0);
A.9
B.-2
C.-1
D.8
14:设有变量说明语句int a=1,b=0;
则执行以下程序段的输出结果为( )。
switch (a)
{
case 1:
switch (b)
{
case 0:printf("*0*");break;
case 1:printf("*1*");break;
}
case 2:printf("*2*");break;
钟山职业技术学院计算机应用技术专业怎么样?录取分数线..
时间:2024-06-08 08:35:12甘肃上重庆三峡职业学院多少分 分数线及排名
时间:2024-06-08 08:32:53武汉城市学院电子商务专业怎么样?录取分数线多少分
时间:2024-06-08 08:30:02内蒙古高考特殊类型提前批报考控制线是多少分
时间:2024-06-07 16:24:56西藏高考特殊类型提前批报考控制线是多少分
时间:2024-06-07 16:24:03青海高考特殊类型提前批报考控制线是多少分
时间:2024-06-07 16:23:14