Chat with us

Read online free dumps for Oracle- 1z0-851

Here you can read online questions and answers for Oracle Exam 1z0-851 (Java Standard Edition 6 Programmer Certified Professional Exam ) 100% free...

Question ID 3653

Given a pre-generics implementation of a method:
11.    public static int sum(List list) {
12.    int sum = 0;
13.    for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
14.    int i = ((Integer);
15.    sum += i;
16.    }
17.    return sum;
18.    }
What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.)


Option A

A.    Remove line 14.

Option B

B.    Replace line 14 with "int i =;".

Option C

C.    Replace line 13 with "for (int i : intList) {".

Option D

D.    Replace line 13 with "for (Iterator iter : intList) {".

Option E

E.    Replace the method declaration with "sum(List<int> intList)".

Option F

F.    Replace the method declaration with "sum(List<Integer> intList)".

Correct Answer A,C,F
Update Date and Time 2016-02-24 13:59:10

Question ID 3654

A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add(0, object), but does NOT need to support quick random access. What supports these requirements?

Option A

A.    java.util.Queue

Option B

B.    java.util.ArrayList

Option C

C.    java.util.LinearList

Option D

D.    java.util.LinkedList

Correct Answer D
Update Date and Time 2016-02-24 14:01:06