AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-851





Question ID 3928

A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?
 

Option A

A.    class MinMax<E extends Comparable<E>> {
E min = null;
E max = null;
public MinMax() {}
public void put(E value) { /* store min or max */ }
 

Option B

B.    class MinMax<E implements Comparable<E>> {
E min = null;
E max = null;
public MinMax() {}
public void put(E value) { /* store min or max */ }
 

Option C

C.    class MinMax<E extends Comparable<E>> {
<E> E min = null;
<E> E max = null;
public MinMax() {}
public <E> void put(E value) { /* store min or max */ }
 

Option D

D.    class MinMax<E implements Comparable<E>> {
<E> E min = null;
<E> E max = null;
public MinMax() {}
public <E> void put(E value) { /* store min or max */ }
 

Correct Answer A
Explanation


Question ID 3929

Given:
3.    import java.util.*;
4.    public class G1 {
5.    public void takeList(List<? extends String> list) {
6.    // insert code here
7.    }
8.    }
Which three code fragments, inserted independently at line 6, will compile? (Choose three.)
 

Option A

A. list.add("foo");
 

Option B

B.    Object o = list;
 

Option C

C.    String s = list.get(0);
 

Option D

D.    list = new ArrayList<String>();
 

Option E

E.    list = new ArrayList<Object>();

Correct Answer B,C,D
Explanation

Send email to admin@getfreedumps for new dumps request!!!