java软件开发工程师笔试题
public class ThrowsDemo
{
static void throwMethod()
{
www.77xue.com哦
System.out.println("Inside throwMethod.");
throw new IllegalAccessException("demo");
}
public static void main(String args[])
{
try
{
throwMethod();
}
catch (IllegalAccessException e)
{
System.out.println("Caught " + e);
}
}
}
Choices:
What is the result when you compile and run the following code?
public class ThrowsDemo
{
static void throwMethod()
{
System.out.println("Inside throwMethod.");
throw new IllegalAccessException("demo");
}
public static void main(String args[])
{
try
{
throwMethod();
}
catch (IllegalAccessException e)
{
System.out.println("Caught " + e);
}
}
}
Choices:
A.Compilation error
B.Runtime error
C.Compile successfully, nothing is printed.
D.Inside throwMethod. followed by caught:java.lang.IllegalAccessExcption: demo
8:Which of the following statements are not legal?
A.long l = 4990;
B.int i = 4L;
C.double d = 34.4;
D.double t = 0.9F.
9:
Give the following java class:
public class Example{
public static void main(String args[]){
static int x[] = new int[15];
System.out.println(x[5]);
}
}
Which statement is corrected?
Give the following java class:
public class Example{
public static void main(String args[]){
static int x[] = new int[15];
System.out.println(x[5]);
}
}
Which statement is corrected?
www.77xue.com哦
A.When compile, some error will occur.
B.When run, some error will occur.
C.Output is zero.
D.Output is null.
10:下面关于变量及其范围的陈述哪些是错的。
A.实例变量是类的成员变量。
B.实例变量用关键字static声明。
C.在方法中定义的局部变量在该方法被执行时创建
D.局部变量在使用前必须被初始化。
11:
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?
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)
《java软件开发工程师笔试题》相关文章
- java软件开发工程师笔试题
- › JAVA程序员的个人简历模板
- › java软件工程师个人简历模板
- › java工程师简历模板
- › JAVA软件工程师个人简历范文
- › java工程师求职简历模板
- › java软件工程师求职简历
- › java软件工程师英文简历模板
- › java开发工程师个人简历表
- › 求职简历模板-java软件高级工程师
- › 电子商务java软件开发工程师简历范文
- › java高级工程师简历
- › java软件工程师简历
- 在百度中搜索相关文章:java软件开发工程师笔试题
- 在谷歌中搜索相关文章:java软件开发工程师笔试题
- 在soso中搜索相关文章:java软件开发工程师笔试题
- 在搜狗中搜索相关文章:java软件开发工程师笔试题