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 3820

Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true? (Choose two.)
 

Option A

A.    The class implements java.lang.Comparable.
 

Option B

B.    The class implements java.util.Comparator.
 

Option C

C.    The interface used to implement sorting allows this class to define only one sort sequence.
 

Option D

D.    The interface used to implement sorting allows this class to define many different sort
sequences.
 

Correct Answer A,C
Explanation


Question ID 3821

Given:
1.    import java.util.*;
2.    public class Example {
3.    public static void main(String[] args) {
4.    // insert code here
5.    set.add(new Integer(2));
6.    set.add(new Integer(1));
7.    System.out.println(set);
8.    }
9.    }
Which code, inserted at line 4, guarantees that this program will output [1, 2]?

Option A

A. Set set = new TreeSet();
 

Option B

B.    Set set = new HashSet();
 

Option C

C.    Set set = new SortedSet();
 

Option D

D.    List set = new SortedList();
 

Correct Answer A
Explanation

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