没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
1. Which of the following method in JUnit would clean the common objects?
a) setUp()
b) constructor()
c) teardown()
d) Ignore
2. ‘this’ is used for referring
a) Super class object
b) The object invoked the method
c) Any object used in the application
d) Ignore
3. Which of the following statements are TRUE regarding the JUnit?
i. It is open source frame work
ii. It is used to write and run repeatable tests
a) Both i and ii
b) Only i
c) Only ii
d) Neither i and ii
4. An abstract class
a) Can neither be instantiated nor it can be referenced
b) Can be instantiated
c) Can be referenced
d) Cannot have data members
5. Consider a class called Student. Which among the following is true about the following
statement?
Student [] x=new Student [3];
a) This statement causes a compilation error
b) This statement creates 3 student references
c) This statement creates 3 student objects
d) This statement causes a runtime error
6. A overriding method can call a overridden method by
a) this . methodName()
b) methodName()
c) super.methodName()
d) none of the options
7. Which of the following statement are true with respect to final keyword?
i. If a method is marked as final it will not be inherited in sub classes
ii. Classes can be marked as final but not methods
iii. If a method is marked as final it cannot be overridden in a child class
1
iv. Abstract method can also not be marked as final
a) Only i and ii
b) Only iii and iv
c) Only i and iii
d) All i , ii ,iii and iv
8. What would be the output when the following program is compiled /run?
Public class Boxer {
Integer integer=10;
int count = 100 ;
public static void main (String [] args ){
Boxer boxer= new Boxer ();
boxer. count=1000;
System.out.println ( boxer. count + boxer. Integer );
}
}
a) 101000
b) 10100
c) 1010
d) Compiler error
9. Which of the following statements is true regarding QA4J?
i. It does the static analysis of the code before being tested.
ii. Ensures the high usability, maintainability and portability of the code
a) Both i and ii
b) Only ii
c) Neither i nor ii
d) Only i
10. After which statement will the object referenced by obj1 become eligible for garbage
collection in the following code?
Public class MyBoxingDemo{
Public void go(){
Integer obj1=10;
Integer obj2=obj1;
Obj1=null;
System.out.println(obj2);
Integer obj3=0;
Obj2=null;
}
Public static void main (String [] args){
2
MyBoxingDemo mb=new MyBoxingDemo();
Mb.go();
}
}
a) Integer obj3=0;
b) Obj2=null;
c) Obj1=null;
d) It will not be eligible for garbage collection during the run of program
11. Which of the following is false about the Assertion in JUnit?
a) Can avoid usage of if-else
b) Assertions can be disabled at the time of deployment
c) Simple but difficult to maintain
d) Ignore
12. What is output of the following code
Class FirstClass{
FirstClass(){
System.out.println(“1”);
}
}
Class SecondClass extends FirstClass{
SecondClass(){
System.out.println (“2”);
}
Public static void main (String [] args){
SecondClass sc=new SecondClass();
System.out.println(“3”);
}
}
a) 3
b) 213
3
剩余11页未读,继续阅读
资源评论
- peter4454997532013-03-01很好,有些答案,谢谢了
- mvp200620102012-06-18题目量不多,有些题是重复的,不过还是算个好资源
- Candy链上笔记2013-12-27JAVA试题英文版的真的超难找,基础试题巩固知识还是不错的。
- gamer12012-08-06楼主很贴心,标出了答案
lijiane1024
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功