高考知识网 时间:2023-08-23 07:49:30
选择题
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个子阶段,以下哪一个是正常的开发顺序?
中国点击率最高的一篇文章 !
2023-08-13 03:45:29山东大学在福建高考招生计划人数和专业代码(参考)
2024-06-08 08:59:56广州华南商贸职业学院在福建高考招生计划人数和专业代码(参考)
2024-06-08 08:56:34陕西高考610至620分左右理科可以上什么大学
2024-06-08 08:53:10湖南上东北师范大学多少分 分数线及排名
2024-06-08 08:49:38天津艺术职业学院对比安徽国防科技职业学院哪个好 附分数线排名
2024-06-08 08:46:04保定学院网络与新媒体专业怎么样?录取分数线多少分
2024-06-08 08:42:14河北新闻网两学一做知识竞赛(试题+答案完整版)
2023-08-13 23:55:25河北新闻网两学一做知识竞赛活动试题答案
2023-08-14 04:06:25两学一做学习教育知识竞赛活动10篇
2023-08-21 12:22:13中国银联笔试题和面试题答案
2023-08-26 22:34:27中国广东核电集团智力测试题
2023-08-21 16:30:55电子类笔试题和面试题答案
2023-08-11 17:30:02