Java工程师笔试题和面试题答案
2021-08-10 07:57:07华夏高考网选择题
1:Which modifier should be applied to a method for the lock of object this to be obtained prior to excution any of the method body?
A.synchronized
B.abstract
C.final
D.static
2:
Give the following java source fragement:
//point x
public class Interesting{
//do something
}
Which statement is correctly Java syntax at point x?
Give the following java source fragement:
//point x
public class Interesting{
//do something
}
Which statement is correctly Java syntax at point x?
A.public class MyClass{//do other thing…}
B.static int PI=3.14
C.class MyClass{//do something…}
D.none
3:
What is the result when you compile and run the following code?
public class Test
{
public void method()
{
for(int i = 0; i < 3; i++)
{
System.out.print(i);
}
System.out.print(i);
}
}
Choices:
What is the result when you compile and run the following code?
public class Test
{
public void method()
{
for(int i = 0; i < 3; i++)
{
System.out.print(i);
}
System.out.print(i);
}
}
Choices:
A.0122
B.0123
C.Compilation error
D.None of these
4: Which of the following statements are true?
A.The automatic garbage collection of the JVM Pvents programs from ever running out of memory
B.A program can suggest that garbage collection be performed and force it
C.Garbage collection is platform independent
D.An object becomes eligible for garbage collection when all references denoting it are set to null.
5:
Give the following method:
public void method( ){
String a,b;
a=new String(“hello world”);
b=new String(“game over”);
System.out.println(a+b+”ok”);
a=null;
a=b;
System.out.println(a);
}
In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.
Give the following method:
public void method( ){
String a,b;
a=new String(“hello world”);
b=new String(“game over”);
System.out.println(a+b+”ok”);
a=null;
a=b;
System.out.println(a);
}
In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.
A.before line 5
B.before line 6
C.before line 7
D.before line 9
6:
Give this class outline:
class Example{
private int x;
//rest of class body…
}
Assuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.java?
Give this class outline:
class Example{
private int x;
//rest of class body…
}
Assuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.java?
A.Change private int x to public int x
B.change private int x to static int x
C.Change private int x to protected int x
D.change private int x to final int x
7:
Given the following class definition:
class A{
protected int i;
A(int i){
this.i=i;
}
}
which of the following would be a valid inner class for this class?
Select valid answer:
Given the following class definition:
class A{
protected int i;
A(int i){
this.i=i;
}
}
which of the following would be a valid inner class for this class?
Select valid answer:
A.class B{ }
B.class B extends A{ }
C.class B extends A{ B(){System.out.println(“i=”+i);} }
D.class B{ class A{} }
8:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序?
相关推荐
中国点击率最高的一篇文章 !2021-12-23 01:49:29
中国银联笔试题和面试题答案2021-08-10 07:57:05
中国广东核电集团智力测试题2021-08-10 07:57:03
电子类笔试题和面试题答案2021-08-10 07:56:55
保山中医药高等专科学校是公办还是民办?(现在学校口碑怎么样)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
中国银联笔试题和面试题答案2021-08-10 07:57:05
中国广东核电集团智力测试题2021-08-10 07:57:03
电子类笔试题和面试题答案2021-08-10 07:56:55
最新发布
图文推荐
益阳师范高等专科学校是公办还是民办?
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