[April 2018] 2018 Lead2pass New Updated 1Z0-808 Exam Questions 256q

2018 Latest Lead2pass 1Z0-808 Questions & Answers PDF Free Download:

https://www.lead2pass.com/1z0-808.html

QUESTION 1
Given:

11

Which option enables the code to compile?

12

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: D

QUESTION 2
Given the code fragment:

21

What is the result?

A.    [Robb, Rick, Bran]
B.    [Robb, Rick]
C.    [Robb, Bran, Rick, Bran]
D.    An exception is thrown at runtime.

Answer: A
Explanation:
After adding elements to names we have a list with four elements and element “Bran” repeated.
After removing element “Bran” we have a list with three elements [Robb, Rick, Bran].
remove method removes the first occurrence of the specified element from this list, if it is present. If the list does not contain the element, it is unchanged.
https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#remove-java.lang.Object-

QUESTION 3
Given:

31

What is the result?

A.    C B A
B.    C
C.    A B C
D.    Compilation fails at line n1 and line n2

Answer: C

QUESTION 4
Given:

41

What is the result?

A.    3 4 5 6
B.    3 4 3 6
C.    5 4 5 6
D.    3 6 4 6

Answer: C
Explanation:
Since variable i is static, it is shared by all instances of X. When code executes x2.i = 5, x1.i = 5 too.
Since variable j isn’t static, each instance of X has its own copy of j.

QUESTION 5
Given the code fragment:

51

Which code fragment, when inserted at line 3, enables the code to print 10:20?

A.    int[] array = new int[2];
B.    int[] array;
array = int[2];
C.    int array = new int[2];
D.    int array [2] ;

Answer: A

QUESTION 6
Given the code fragment:

61

What is the result?

A.    A B C Work done
B.    A B C D Work done
C.    A Work done
D.    Compilation fails

Answer: C

QUESTION 7
Which three are advantages of the Java exception mechanism?

A.    Improves the program structure because the error handling code is separated from the normal program function
B.    Provides a set of standard exceptions that covers all the possible errors
C.    Improves the program structure because the programmer can choose where to handle exceptions
D.    Improves the program structure because exceptions must be handled in the method in which they occurred
E.    Allows the creation of new exceptions that are tailored to the particular program being created

Answer: ACE
Explanation:
B is false. Standard exceptions not cover all possible errors.
D is false. Exceptions don’t have to be handled in the method in which they occurred.

QUESTION 8
Given the code from the Greeting.Java file:

81

Which set of commands prints Hello Duke in the console?

82

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: C
Explanation:
Source code file names must have .java suffixes to compile with javac
We interpret or run the program with “java <class name without suffix> arguments”
http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html
http://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html

1Z0-808 dumps full version (PDF&VCE): https://www.lead2pass.com/1z0-808.html

Large amount of free 1Z0-808 exam questions on Google Drive: https://drive.google.com/open?id=0B3Syig5i8gpDcUlVNUZXak8zSGc