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;
金山職業技術學院對比四川汽車職業技術學院哪個好 附分..
時間:2025-05-22 09:08:12成都銀杏酒店管理學院在重慶高考招生計劃人數和專業代..
時間:2025-05-22 09:05:01四川上山東理工大學多少分 分數線及排名
時間:2025-05-22 09:01:18江西高考理科533分排名多少 排名多少位次
時間:2025-05-22 08:57:21大連東軟信息學院對比甘肅民族師范學院哪個好 附分數線..
時間:2025-05-22 08:53:39廣東高考455至460分左右物理可以上什么大學
時間:2025-05-22 08:49:52