選擇題
1:Which statement about the garbage collection mechanism are true?
A.Garbage collection require additional programe code in cases where multiple threads are running.
B.The programmer can indicate that a reference through a local variable is no longer of interest.
C.The programmer has a mechanism that explicity and immediately frees the memory used by Java objects.
D.The garbage collection mechanism can free the memory used by Java Object at explection time.
2:
Given:
1. public class test (
2. public static void main (String args[]) {
3. int i = 0xFFFFFFF1;
4. int j = ~i;
5.
6. }
7. )
What is the decimal value of j at line 5?
Given:
1. public class test (
2. public static void main (String args[]) {
3. int i = 0xFFFFFFF1;
4. int j = ~i;
5.
6. }
7. )
What is the decimal value of j at line 5?
A.0
B.1
C.14
D.-15
3:
What happens when you try to compile and run the following program?
class Mystery{
String s;
public static void main(String[] args){
Mystery m=new Mystery();
m.go();
}
void Mystery(){
s=”constructor”;
}
void go(){
System.out.println(s);
}
}
What happens when you try to compile and run the following program?
class Mystery{
String s;
public static void main(String[] args){
Mystery m=new Mystery();
m.go();
}
void Mystery(){
s=”constructor”;
}
void go(){
System.out.println(s);
}
}
A.this code compliles but throws an exception at runtime
B.this code runs but nothing appears in the standard output
C.this code runs and “constructor” in the standard output
D.this code runs and writes ”null” in the standard output
4:
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?
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
5:
下述程序代碼中有語法錯誤的行是( )。
int i,ia[10],ib[10]; /*第一行*/
for (i=0;i<=9;i++) /*第2行*/
ia[i]=0; /*第3行*/
ib=ia; /*第4行*/
金山職業技術學院對比四川汽車職業技術學院哪個好 附分..
時間: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
中國點擊率最高的一篇文章 !2023-08-13 03:45:29
海南上長春工業大學多少分 分數線及排名2025-05-22 09:28:45
科爾沁藝術職業學院對比山東水利職業學院哪個好 附分數線排名2025-05-22 09:25:00
呼和浩特職業學院對比山西警官職業學院哪個好 附分數線排名2025-05-22 09:22:04
四川工程職業技術學院在上海高考招生計劃人數和專業代碼(參考)2025-05-22 09:19:52
泰山科技學院對比西安理工大學高科學院哪個好 附分數線排名2025-05-22 09:16:28
江西航空職業技術學院在云南高考招生計劃人數和專業代碼(參考)2025-05-22 09:13:20
遼寧特殊教育師范高等專科學校對比江西工商職業技術學院哪個好 附分數線排名2025-05-22 09:10:51
聯合利華(Unilever)校園招聘筆試真題2023-08-23 02:30:46
格力機械類筆試真題分享2023-08-12 04:32:32
德勤公司招聘的筆試推理題2023-08-27 04:13:57 




