选择题
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;//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;//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行/
2020年河北新闻网两学一做
时间:2023-09-18 07:0:242020年河北新闻网两学一做
时间:2023-09-15 11:0:59两学一做学习教育知
时间:2023-09-21 06:0:302020年开展两学一做学习教
时间:2023-09-19 21:0:30
联合利华(Unilever)校园招聘笔试真题2023-09-15 18:31:24
格力机械类笔试真题分享2023-09-21 16:59:47
陕西国际商贸学院在重庆高考专业招生计划(人数+代码)2025-05-22 10:38:12
安徽建筑大学和新余学院哪个好 分数线排名对比2025-05-22 10:36:54
襄阳职业技术学院广西录取分数线及招生人数 附-2020最低位次排名2025-05-22 10:35:29
长江大学和新疆师范大学哪个好 分数线排名对比2025-05-22 10:34:16
锦州师范高等专科学校在辽宁高考专业招生计划(人数+代码)2025-05-22 10:32:49
山东高考排名在17550的考生能报什么大学(原创)2025-05-22 10:31:33
广州华立学院的英语专业分数线(附2020-最低分排名怎么样)2025-05-22 10:30:14
兰州石化职业技术大学的理化测试与质检技术专业分数线(附2020-最低分排名怎么样)2025-05-22 10:29:06
泉州师范学院和亳州学院哪个好 分数线排名对比2025-05-22 10:27:53
贵州医科大学在江西高考专业招生计划(人数+代码)2025-05-22 10:26:23
东莞城市学院和西安工商学院哪个好 分数线排名对比2025-05-22 10:24:51
山东海事职业学院的水路运输安全管理专业分数线(附2020-最低分排名怎么样)2025-05-22 10:23:44 


