選擇題
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 prevents 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個子階段,以下哪一個是正常的開發順序?
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
中國銀聯筆試題和面試題答案2023-09-15 14:44:48
中國廣東核電集團智力測試題2023-09-19 07:45:02
陜西國際商貿學院在重慶高考專業招生計劃(人數+代碼)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 


