选择题
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个子阶段,以下哪一个是正常的开发顺序?
金山职业技术学院对比四川汽车职业技术学院哪个好 附分..
时间: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
中国银联笔试题和面试题答案2023-08-26 22:34:27
中国广东核电集团智力测试题2023-08-21 16:30:55
电子类笔试题和面试题答案2023-08-11 17:30:02 




