新华信国际信息咨询JAVA工程师笔试题和面试题答案
2021-08-10 07:38:47华夏高考网选择题
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行*/
相关推荐
中国点击率最高的一篇文章 !2021-12-23 01:49:29
联合利华(Unilever)校园招聘笔试真题2021-08-10 07:38:45
格力机械类笔试真题分享2021-08-10 07:38:42
德勤公司招聘的笔试推理题2021-08-10 07:38:40
保山中医药高等专科学校是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:40:02
昆明幼儿师范高等专科学校是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:38:43
广东邮电职业技术学院是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:37:02
武汉民政职业学院是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:36:26
保山学院是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:34:27
联合利华(Unilever)校园招聘笔试真题2021-08-10 07:38:45
格力机械类笔试真题分享2021-08-10 07:38:42
德勤公司招聘的笔试推理题2021-08-10 07:38:40
最新发布
图文推荐
益阳师范高等专科学校是公办还是民办?
2024-11-23 03:52:06益阳医学高等专科学校是公办还是民办?
2024-11-23 03:49:47武汉交通职业学院是公办还是民办?(现
2024-11-23 03:48:18河北大学医学部是公办还是民办?(现在
2024-11-23 03:46:07三门峡社会管理职业学院是公办还是民
2024-11-23 03:44:36广东工贸职业技术学院是公办还是民办?
2024-11-23 03:42:42保山中医药高等专科学校是公办还是民
2024-11-23 03:40:02昆明幼儿师范高等专科学校是公办还是
2024-11-23 03:38:43