Sudharani - Core Java - SR Associate Assessment - 1520497729331
Sudharani - Core Java - SR Associate Assessment - 1520497729331
Sudharani - Core Java - SR Associate Assessment - 1520497729331
Registration Details
Performance Category
ve ra g e You have been rated as Below Average by the assessor for this test.
Be l o w A
Overall Summary
MARKS SCORED
Score Percentile Percentage
Java 58 / 98 95 59.18
Total 58 / 98 95 59.18
1 / 63
SUMMARY OF ATTEMPTS TIME TAKEN
1 29
hr min
2 / 63
Section-wise Details
Java
MARKS SCORED
Score Percentage
XML 6 / 6 100
Java - 2 / 2 100
Generics_Sapient
Selected
Java - Exception 3 / 4 75
Handling_Sapient
Selected
Java - Design 3 / 4 75
Patterns_Sapient
Selected
SOA - 1 / 2 50
Concepts_Sapient
Selected
Core Java_Sapient 3 / 5 60
Selected
Core Java_Sapient 4 / 10 40
Selected
Java - 3 / 4 75
Collections_Sapient
Selected
3 / 63
Hibernate - 1 / 3 33.33
Environment_Sapient
Selected
Java - 2 / 4 50
Threads_Sapient
Selected
JavaScript - 2 / 5 40
Arrays_Sapient
Selected
Java - Junit 4 / 8 50
Java - Junit 0 / 3 0
Total 58 / 98 59.18
29 Incorrect
1 29
(Scored 0/40) hr min
4 / 63
Difficulty Level Analysis
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 24 24 / 24 26 / 36
Difficult (D) 50 50 / 50 32 / 62
Total 74 74 / 74 58 / 98
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 5 5 / 5 3 / 5
Difficult (D) 10 10 / 10 4 / 10
Total 15 15 / 15 7 / 15
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 3 3 / 3 1 / 3
Total 3 3 / 3 1 / 3
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 4 4 / 4 3 / 4
Total 4 4 / 4 3 / 4
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 4 4 / 4 3 / 4
Total 4 4 / 4 3 / 4
5 / 63
Java - Exception Handling_Sapient Selected
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 4 4 / 4 3 / 4
Total 4 4 / 4 3 / 4
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 2 2 / 2 2 / 2
Total 2 2 / 2 2 / 2
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 3 3 / 3 2 / 3
Total 3 3 / 3 2 / 3
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 1 1 / 1 1 / 1
Difficult (D) 3 3 / 3 2 / 3
Total 4 4 / 4 3 / 4
Java - Junit
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 1 1 / 1 0 / 3
Difficult (D) 2 2 / 2 4 / 8
Total 3 3 / 3 4 / 11
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 8 8 / 8 5 / 8
6 / 63
Total 8 8 / 8 5 / 8
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Difficult (D) 4 4 / 4 2 / 4
Total 4 4 / 4 2 / 4
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 2 2 / 2 2 / 2
Difficult (D) 4 4 / 4 3 / 4
Total 6 6 / 6 5 / 6
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 5 5 / 5 2 / 5
Total 5 5 / 5 2 / 5
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 1 1 / 1 3 / 3
Difficult (D) 2 2 / 2 0 / 8
Total 3 3 / 3 3 / 11
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 2 2 / 2 1 / 2
Total 2 2 / 2 1 / 2
UML Diagrams
7 / 63
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 2 2 / 2 6 / 6
Total 2 2 / 2 6 / 6
XML
Difficulty Levels Total no. of questions No. of Attempted questions Marks Scored
Medium (M) 2 2 / 2 6 / 6
Total 2 2 / 2 6 / 6
8 / 63
Question-wise Details
Java
1
2 class Test{
3 public static void main(String[] args) {
4 Test t = new Test();
5 int i = t.check();
6 System.out.println(i);
7 }
8 int check(){
9 try{
10 System.out.println("try block");
11 return 1;
12 }catch(Exception e){
13
14 System.out.println("catch block");
15 return 2;
16 }finally{
17 System.out.println("finally returning");
18 return 3;
19 }
20 }
21 }
22
9 / 63
Options Response Answer
Try block
1
Try block
1
Finally returning
3
Try block
Finally returning
3
Try block
Finally returning
1
Try block
Finally returning
1
3
1 import java.io.IOException;
2
3 class Test{
4
5 public static void main(String[] args) {
6 Test t = new Test();
7 int i = t.check();
8 System.out.println(i);
9 }
10 int check(){
11 try{
12 throw new IOException();
13 }catch(Exception e){
14
15 System.out.println("catch block");
16 return 1;//line 16
17 }finally{
18 System.out.println("finally returning");
19 return 2;
20 }
21 }
22 }
23
10 / 63
Options Response Answer
Catch block
1
Catch block
Finally returning
1
Catch block
Finally returning
2
1
2 class Test{
3 public static void main(String[] args) {
4 Test t = new Test();
5 int i = t.check();
6 System.out.println(i);
7 }
8 int check(){
9 try{
10 System.out.println("try block");
11 return 1;
12 }catch(Exception e){
13
14 System.out.println("catch block");
15 return 2;
16 }finally{
17 System.exit(0);
18 System.out.println("finally returning");
19 return 3;
20 }
21 }
22 }
23
11 / 63
Options Response Answer
Try block
1
Try block
1
Finally returning
3
Try block
Finally returning
3
Try block
Try block
Finally returning
1
3
1
2 class Test{
3 public static void main(String[] args) {
4 Test t = new Test();
5 int i = t.check();
6 System.out.println(i);
7 }
8 int check(){
9 try{
10 System.out.println("try block");
11 System.exit(0);
12 return 1;
13 }catch(Exception e){
14
15 System.out.println("catch block");
16 return 2;
17 }finally{
18 System.out.println("finally returning");
19 return 3;
20 }
21 }
22 }
23
12 / 63
Options Response Answer
Try block
Try block
1
Finally returning
3
Try block
Finally returning
3
Try block
Finally returning
1
Try block
Finally returning
1
3
Which of the following methods can be used for removing focus from the current window?
window.blur()
document.blur()
window.focus()
document.focus()
Which of the following methods will return the day of the month of the date object, according to universal time?
13 / 63
Options Response Answer
getUTCDate()
getUTCDay()
getDay()
none of these
2^31-1
2^63-1
2^53
None of these
14 / 63
Array(16).join("js" - 1) gives -
undefined
Type error
a, b
b, c
a, c
a, b, c
15 / 63
When creating a generic class following syntax is used:
public class test. Which of the following is a reaon for adding <T> to represent generic class?
a only
a, b
a, c
b, c
You have defined a utility method called factorial in the class 'utilities.Math' that accepts an integer as a parameter & returns a
long value. Which of the following rightly defines the EL function in its deployment descriptor?
16 / 63
Options Response Answer
1
2 <function>
3 <name>factorial</name>
4 <function-class>utilities.Math</function-class>
5 <function-signature>java.lang.long factorial(java.lang.integer)</function-signature>
6 </function>
7
1 <method>
2 <name>factorial</name>
3 <method-class>utilities.Math</method-class>
4 <method-signature>java.lang.long factorial(java.lang.integer)</ method-signature>
5 </method>
6
1 <function>
2 <name>factorial</name>
3 <function-class>utilities.Math</function-class>
4 <function-signature>
5 <arguments>integer</arguments>
6 <return-type>long</return-type>
7 </function-signature>
8 </function>
9
None of these
standard actions
Answer Explanation
17 / 63
NULL
1 <%--------%>
2
1 <!-------------/>
2
1 <?--------------?>Â
2
1 <%----------->
2
18 / 63
Options Response Answer
TRANSACTION_READ_UNCOMMITT
ED
TRANSACTION_READ_COMMITTED
TRANSACTION_SERIALIZABLE
TRANSACTION_REPEATABLE_REA
D
Candidate responses were captured before updation of the question with restrictions on maximum responses.
4.0
3.0
5.0
2.0
All raw data types (including binary documents or images) should be read and uploaded to the database as an array of:
19 / 63
Options Response Answer
byte
int
boolean
char
From the following identify the industry standard technologies related to the processing of XML-based data .
20 / 63
Options Response Answer
XData
XQuery
XSLT
XWeb
Candidate responses were captured before updation of the question with restrictions on maximum responses.
1
2 public class CD implements Serializable {
3 String title;
4 String artist;
5 ArrayList tracks;
6 }
7 public void addTrack(Track track) {
8 tracks.add(track);
9 }
10 private class Track {
11 String name;
12 int length;
13 public track(String name, int length) {
14 this.name = name;
15 this.length = length;
16 }
17 }
18 }
19
21 / 63
Options Response Answer
None of these
1
2 public class CD implements Serializable {
3 String title;
4 String artist;
5 ArrayList tracks;
6 public CD(String title, String artist) {
7 this.title = title;
8 this.artist = artist;
9 tracks = new ArrayListO;
10 }
11 public void addTrack(String track) {
12 tracks. add(track);
13 }
14 }
15
Valid
Invalid
22 / 63
Question 22: Time: 2 Min 35 Sec Marks: 0/ 1
A1
A2
A1 & A2
supports applets.
23 / 63
Options Response Answer
38
Compilation Error
Runtime Exception
None of these
24 / 63
What is the output of the following Java code?
1 class q28{
2 public static void main(String as[]){
3 int x=10;
4 int y=20;
5 (x>y)? System.out.println(x) : System.out.println(y);
6
7 }
8 }
9
Compilation Error
Runtime Exception
10
20
None of these
What will be the outcome when the given code is compiled and run?
25 / 63
Options Response Answer
10
Garbage Value
Compilation fails
Runtime Exception
join
sleep
wait
yield
26 / 63
What will be the outcome when the given code is compiled and run?
1 class Test18{
2 public static void main(String as[]){
3 int x=2;
4 final long j=2;
5 switch(x){
6 case 1:
7 System.out.println("1");
8 break;
9
10 case 10:
11 System.out.println("10");
12 break;
13
14 case j:
15 System.out.println("2");
16 break;
17
18 case 5:
19 System.out.println("5");
20 break;
21
22 default:
23 System.out.println("Default");
24 break;
25 }
26 }
27 }
28
compilation error
Runtime Exception
It will output: 2
None of these
27 / 63
What will be the outcome when the given code is compiled and run?
true
false
-1
-32
What will be the outcome when the given code is compiled and run?
28 / 63
Options Response Answer
At compile time
classNotFoundException
What will be the outcome when the given code is compiled and run?
int x[]
string
null
ambiguity error
Runtime Exception
29 / 63
Question 33: Time: 1 Min 38 Sec Marks: 1/ 1
17 17
18 18
18 16
17 36
18 36
What will be the outcome when the given code is compiled and run?
1 class Hello{
2 public static void m1(){
3 System.out.println("M1 in Hello");
4 }
5 }
6 class hai extends Hello{
7 public void m1() throws ClassCastException{
8 System.out.println("M1 in hi");
9 }
10 }
11 public class qq31{
12 public static void main(String as[]){
13 Hello h = new hai();
14 h.m1();
15 }
16 }
17
30 / 63
Options Response Answer
M1 in Hello
M1 in hi
M1 in Hello M1 in hi
Compilation fails
Unreported
Exception
What will be the outcome when the given code is compiled and run?
17 17
17 12
10 12
24 17
24 10
31 / 63
What would be the output of the following code?
32 / 63
What would be the output of the following code?
t.start();
}
}
foo
Example
foo
Example
baz
Example
bar
33 / 63
What would be the output on running the following code?
1
2 class Parent {
3 Child display(int i) {//line 2
4 System.out.println("Parent");
5 return null;
6 }
7 }
8
9 class Child extends Parent {
10 Parent display(int i){//line 9
11 System.out.println("Child");
12 return null;
13 }
14 public static void main(String[] args) {
15 Parent p = new Child();
16 p.display(5);
17 }
18 }
19
Parent
Child
NullPointer exception
Given that name of the PlatformTransactionManager bean is "transactionManager" which annotations are required to switch on
transactions support in following test?
1
2 @RunWith(SpringJUnit4ClassRunner.class)
3 @ContextConfiguration
4 public class DaoTest {
5 //test methods
6 }
7
34 / 63
Options Response Answer
@Transactional
@TransactionConfiguration(transaction
Manager = "transactionManager")
@TestExecutionListeners({Transaction
alTestExecutionListener.class})
Answer Explanation
null
1
2 @Before("execution(* method*()")
3
4
5 and the following class:
6
7 public class MyClass() {
8 public void method1() {
9 method2();
10 }
11 public void method2() {
12 }
13 }
14
15
16
If we call, myClass.method1(), from another class, which methods does the advice run against?
method1
method2
both
neither
35 / 63
Answer Explanation
null
T1
1. SELECT * FROM EVENTS
4. SELECT * FROM EVENTS
and T2
2. INSERT INTO EVENTS VALUES (...)
3. COMMIT
READ_UNCOMMITTED
READ_COMMITTED
REPEATABLE_READ
SERIALIZABLE
Answer Explanation
null
What are the ways offered by spring to construct the following interdependent objects?
1
2 class ObjectOne {
3 ObjectTwo ref;
4 public ObjectOne(ObjectTwo two) { } }
5 class ObjectTwo {
6 ObjectOne ref;
7 public ObjectTwo(ObjectOne two) { } }
8
36 / 63
Options Response Answer
Answer Explanation
NULL
1
2 <filter>
3 <filter-name>_______________</filter-name>
4 <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
5 </filter>
6
7
securityFilterChain
securitySpringFilterChain
springSecurityFilter
springSecurityFilterChain
Answer Explanation
null
37 / 63
Using Spring how can we achieve Java serialization via HTTP?
HttpInvokerProxyFactoryBean/HttpInvo
kerServiceExporter
HTTPSession
None of these
Answer Explanation
null
Which of the following are valid ways to run the following query in Spring?
String result =
jdbcTemplate.queryForInt(sql);
String result =
jdbcTemplate.queryForString(sql);
String result =
jdbcTemplate.queryForObject(sql);
Answer Explanation
null
38 / 63
Question 46: Time: 1 Min 29 Sec Marks: 1/ 1
void convertAndSend(Destination
destination,Object message)
String
buildExceptionMessage(JMSException
e)
void commitIfNecessary(Session
session)
Answer Explanation
null
39 / 63
What is the output of the following program?
output is
Thread-0 is active
Thread-0 is active
Thread-1 is active
Thread-1 is active
output is
Thread-0 is active
Thread-1 is active
Thread-1 is active
Thread-0 is active
40 / 63
Question 48: Time: 33 Sec Marks: 1/ 1
41 / 63
What is the output of the following program?
output is small
output is big
compilation error
42 / 63
What is the output of the following program?
1
2 public class ThreadDemo implements Runnable {
3 public static void main(String[] args) {
4
5 Thread tobj1 = new Thread(new ThreadDemo());
6 tobj1.setName("POLO-1");
7 tobj1.setPriority(10);
8 tobj1.start();
9
10 Thread tobj2 = new Thread(new ThreadDemo());
11 tobj2.setName("POLO-2");
12 tobj2.setPriority(1);
13 tobj2.start();
14 }
15
16 public void run() {
17 for (int i = 0; i < 5; i++) {
18
19 System.out.println(Thread.currentThread().getName() + " " + i);
20 try {
21 Thread.sleep(100);
22 } catch (Exception e) {
23 System.out.println(e);
24 }
25 }
26 }
27 }
28
29
30
43 / 63
output will be
POLO-1 0
POLO-2 0
POLO-1 1
POLO-2 1
POLO-1 2
POLO-2 2
POLO-2 3
POLO-1 3
POLO-1 4
POLO-2 4
output will be
POLO-1 0
POLO-2 0
POLO-1 1
POLO-2 1
POLO-1 2
POLO-2 2
POLO-1 3
POLO-2 3
POLO-1 4
POLO-2 4
44 / 63
output will be
POLO-2 0
POLO-1 0
POLO-2 1
POLO-1 1
POLO-2 2
POLO-1 2
POLO-2 3
POLO-1 3
POLO-2 4
POLO-1 4
45 / 63
What would be the output of the following code?
1 import java.util.HashSet;
2 import java.util.Iterator;
3 import java.util.Set;
4
5 class Test{
6 Integer id;
7 Test(int id){
8 this.id = id;
9 }
10 public String toString() {
11 return this.id.toString();
12 }
13 public int hashCode() {
14 int result = 1;
15 result = 31 + ((id == null) ? 0 : id.hashCode());
16 return result;
17 }
18 public static void main(String[] args) {
19 Set s = new HashSet();
20 Test t1 = new Test(1);
21 Test t2 = new Test(1);
22 Test t3 = new Test(2);
23 s.add(t1);
24 s.add(t2);
25 s.add(t3);
26 System.out.println(s.size());
27 Iterator iter = s.iterator();
28 while(iter.hasNext())
29 System.out.println(iter.next());
30 }
31 }
32
2
1
2
2
1
1
2
3
1
2
3
1
1
2
46 / 63
Question 52: Time: 1 Min 9 Sec Marks: 1/ 1
1
2 import java.util.TreeMap;
3 import java.util.Iterator;
4 import java.util.Map;
5 import java.util.Set;
6
7 class Test implements Comparable{
8 public int hashCode() {
9 int result = 1;
10 result = 31 + ((id == null) ? 0 : id.hashCode());
11 return result;
12 }
13 public Boolean equals(Object obj) {
14 Test other = (Test) obj;
15 Boolean ret = false;
16 if(other.id.equals(this.id))
17 ret = true;
18 return ret;
19 }
20 Integer id;
21 Test(int id){
22 this.id= id;
23 }
24 public String toString() {
25 return this.id.toString();
26 }
27 public static void main(String[] args) {
28 Test t1 = new Test(1);
29 Test t2 = new Test(1);
30 Map m = new TreeMap();
31 m.put(t1, 1);
32 m.put(t2, 1);
33 System.out.println(m.size());
34 Set s = m.keySet();
35 Iterator iter = s.iterator();
36 while(iter.hasNext())
37 System.out.println(iter.next());
38 }
39 public int compareTo(Object o) {
40 return this.id.compareTo(((Test)o).id);
41 }
42 }
43
47 / 63
Options Response Answer
2
1
1
2
1
1
1
Runtime exception
48 / 63
What would be the output of the following program?
1 import java.util.Iterator;
2 import java.util.Set;
3 import java.util.TreeSet;
4
5 class Test implements Comparable{
6 Integer id;
7 Test(int id){
8 this.id = id;
9 }
10 public String toString() {
11 return this.id.toString();
12 }
13 public int hashCode() {
14 int result = 1;
15 result = 31 + ((id == null) ? 0 : id.hashCode());
16 return result;
17 }
18 @Override
19 public Boolean equals(Object obj) {
20 return this.id.equals(((Test)obj).id);
21 }
22 public static void main(String[] args) {
23 Set s = new TreeSet();
24 Test t1 = new Test(1);
25 Test t3 = new Test(2);
26 s.add(t1);
27 s.add(t3);
28 System.out.println(s.size());
29 Iterator iter = s.iterator();
30 while(iter.hasNext())
31 System.out.println(iter.next());
32 }
33 @Override
34 public int compareTo(Object o) {
35 return 0;
36 }
37 }
38
2
1
2
2
2
1
1
1
1
2
49 / 63
Question 54: Time: 39 Sec Marks: 0/ 1
1 import java.util.Iterator;
2 import java.util.Set;
3 import java.util.TreeSet;
4
5 class Test{
6 Integer id;
7 Test(int id){
8 this.id = id;
9 }
10 public String toString() {
11 return this.id.toString();
12 }
13 public int hashCode() {
14 int result = 1;
15 result = 31 + ((id == null) ? 0 : id.hashCode());
16 return result;
17 }
18 @Override
19 public Boolean equals(Object obj) {
20 return this.id.equals(((Test)obj).id);
21 }
22 public static void main(String[] args) {
23 Set s = new TreeSet();
24 Test t1 = new Test(1);
25 Test t3 = new Test(2);
26 s.add(t1);
27 s.add(t3);
28 System.out.println(s.size());
29 Iterator iter = s.iterator();
30 while(iter.hasNext())
31 System.out.println(iter.next());
32 }
33 }
34
35
2
1
2
2
2
1
java.lang.ClassCastException will
come at runtime
50 / 63
Question 55: Time: 24 Sec Marks: 1/ 1
Answer Explanation
null
REST
SOAP
HTTP
Answer Explanation
null
51 / 63
Options Response Answer
1 @DELETE
2 @class("{empId}")
3 public void deleteEmployee(@PathParam("empId") int empId)
4 {
5
6
7 }
8
1 @DELETE
2 @Path("{empId}")
3 public void deleteEmployee(@PathParam("empId") int empId)
4 {
5
6
7 }
8
1 @DELETE
2 @Class("{empId}")
3 public void deleteEmployee(@classParam("empId") int empId)
4 {
5
6
7 }
8
Which of the following companies already have a set of public REST Web services available?
1. Amazon
2. Google
3. O'Reillys Meerkat
4. Flickr
5. Yahoo
52 / 63
Options Response Answer
While creating a JAX-RS (RESTful) Web Service, which of the following statements describes the role of using JAXB?
53 / 63
Options Response Answer
1 <?xml version="1.0"?>
2 <soap:Envelope>
3 xmnls :soap = "http://www.w3.org/2001/12/soap-envelope"
4 soap:encodingStyle=" http://www.w3.org/2001/12/soap-encoding"
5 < soap:Header>
6 ⠦⠦⠦
7 < /soap: Header >
8 <soap : Fault >
9 ⠦⠦..
10 <soap: Body >
11 ⠦⠦⠦⠦
12 < /soap: Body >
13 < /soap:Fault >
14 </soap:Envelope>
15
1 <?xml version="1.0"?>
2 <soap:Envelope>
3 xmnls :soap = "http://www.w3.org/2001/12/soap-envelope"
4 soap:encodingStyle=" http://www.w3.org/2001/12/soap-encoding"
5 < soap:Header>
6 ⠦⠦⠦
7 < /soap: Header >
8 <soap : Body >
9 ⠦⠦..
10 <soap: Fault >
11 ⠦⠦⠦⠦
12 < /soap: Fault >
13 < /soap: Body >
14 </soap:Envelope>
15
1 <?xml version="1.0"?>
2 <soap:Envelope>
3 xmnls :soap = "http://www.w3.org/2001/12/soap-envelope"
4 soap:encodingStyle=" http://www.w3.org/2001/12/soap-encoding"
5 < soap:Envelope>
6 ⠦⠦⠦
7 < /soap: Envelope>
8 <soap : Body >
9 ⠦⠦..
10 <soap: Fault >
11 ⠦⠦⠦⠦
12 < /soap: Fault >
13 < /soap: Body >
14 </soap:Header>
15
Answer Explanation
null
54 / 63
Question 61: Time: 2 Min 29 Sec Marks: 1/ 1
In Decorator Pattern as we use inheritance to achieve type matching of decorator classes with ConcreteComponent class,
what do we use to get the behavior of decorator classes.
Inheritance
Aggregation
Composition
Generalization
Let there be an application showing a JFrame(like a pop up window) instance (J1) with a button, clicking on which creates
another JFrame instance (J2) with some text. Every time the button is clicked a new JFrame instance (similar to J2) appears
with the text. Which design pattern among the following can be used in order to ensure that same JFrame instance (J2) is
shown every time the button on JFrame (J1) is clicked?
Adapter
Template
Singleton
Observer
Factory design pattern depends upon __________ and do not depends upon _________
55 / 63
Options Response Answer
Abstraction, Interface
Answer Explanation
Answer Explanation
56 / 63
Which of the following is not a major design consideration for the system?
Mr X wants to find out if his program will execute forever if it runs. Which of the following statements is correct if he wants to test
his program to find out whether his program will execute forever or not?
57 / 63
Options Response Answer
Quality management
Risk management
Performance management
Efficiency management
58 / 63
Options Response Answer
1 import org.junit.Test;
2 import org.junit.Ignore;
3 import static org.junit.Assert.assertEquals;
4 public class TestJunit {
5 String message = "Metl";
6 MessageUtil messageUtil = new MessageUtil(message);
7 @Ignore
8 @Test
9 public void testPrintMessage() {
10 System.out.println("Inside testPrintMessage()");
11 message = "Metl";
12 assertEquals(message,messageUtil.printMessage());
13 }
14
1 import org.junit.Test;
2 import org.junit.Ignore;
3 import static org.junit.Assert.assertEquals;
4 public class TestJunit {
5 String message = "Metl";
6 MessageUtil messageUtil = new MessageUtil(message);
7
8 public void @Ignore.testPrintMessage() {
9 System.out.println("Inside testPrintMessage()");
10 message = "Metl";
11 assertEquals(message,messageUtil.printMessage());
12 }
13
1 import org.junit.Test;
2 import org.junit.Ignore;
3 import static org.junit.Assert.assertEquals;
4 public class TestJunit {
5 String message = "Metl";
6 MessageUtil messageUtil = new MessageUtil(message);
7
8 public void testPrintMessage() {
9 System.out.println("Inside testPrintMessage(@ignore)");
10 message = "Metl";
11 assertEquals(message,messageUtil.printMessage());
12 }
13
Answer Explanation
null
59 / 63
Which of the following codes will be written to define the two test classes that are executed?
1 package com.xyz.junit.first;
2
3 import org.junit.runner.RunWith;
4 import org.junit.runners.Suite;
5 import org.junit.runners.Suite.SuiteClasses;
6
7 @RunWith(Suite.class)
8 @SuiteClasses({ My1ClassTest.class, My2ClassTest.class })
9
1 package com.xyz.junit.first;
2
3 import org.junit.runner.RunWith;
4 import org.junit.runners.Suite;
5
6 @RunWith(Suite.class)
7 @SuiteClasses({ My1ClassTest.class, My2ClassTest.class })
8 public class AllTests {
9
10 }
11
1 package com.xyz.junit.first;
2
3 import org.junit.runner.RunWith;
4 import org.junit.runners.Suite;
5 import org.junit.runners.Suite.SuiteClasses;
6
7 ({ My1ClassTest.class, My2ClassTest.class })
8 public class AllTests;
9
1 package com.xyz.junit.first;
2
3 import org.junit.runner.RunWith;
4 import org.junit.runners.Suite;
5 import org.junit.runners.Suite.SuiteClasses;
6
7 @RunWith(Suite.class)
8 @SuiteClasses({
9 My1ClassTest.class, My2ClassTest.class })
10 public class AllTests {}
11
Answer Explanation
null
60 / 63
Question 70: Time: 21 Sec Marks: 3/ 3
What are the different views being considered while creating Object oriented software system?
design view
process view
all of these
______ are not only used for visualizing dynamic nature of a system but are also used to construct the executable system by
using forward and reverse engineering techniques?
activity diagrams
state diagrams
none of these
61 / 63
What will the following command do?
62 / 63
The new assertEquals methods use Autoboxing, hence the assertEquals is tested as which of the following options?
assertEquals(primitive, primitive)
assertEquals(Object, Object)
assertEquals(primitive, Object)
assertEquals(Object, primitive)
Answer Explanation
null
Test Log
07 Mar,2018
63 / 63