JAVA系统分析笔试题
JAVA系统分析笔试题
选择题
1:public class X{
web服务器提供的服务是哪些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)终止代码process
D.never in this method
2:Use the operator “>>” and “>>>”. Which statement is true?
A.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 0000 1010 0000 0000 0000 0000 0000 0000
B.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 1111 1010 0000 0000 0000 0000 0000 0000
C.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 0000 0000 0000 0000 0000 0000 0000 0000
D.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 1111 1010 0000 0000 0000 0000 0000 0000
3:The following code is entire contents of a file called Example.java,causes precisely one error during compilation:
class SubClass extends BaseClass{
}
class BaseClass(){
String str;
public BaseClass(){
System.out.println(“ok”);}
一年php工程师难吗
java定时器任务public BaseClass(String s){
str=s;}}
public class Example{
public void method(){
SubClass s=new SubClass(“hello”);
BaseClass b=new BaseClass(“world”);
}
}
java常见笔试题Which line would be cause the error?
The following code is entire contents of a file called Example.java,causes precisely one error during compilation:
class SubClass extends BaseClass{
}
class BaseClass(){
String str;
public BaseClass(){
System.out.println(“ok”);}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。