Which two are valid initialization statements?

Which two are valid initialization statements?

Which two are valid initialization statements?

A.
Map<String, String> m = new SortedMap<String, String>();

B.
Collection m = new TreeMap<Object, Object>();

C.
HashMap<Object, Object> m = new SortedMap<Object, Object>();

D.
SortedMap<Object, Object> m = new TreeMap<Object, Object> ();

E.
Hashtable m= new HashMap();

F.
Map<List, ArrayList> m = new Hashtable<List, ArrayList>();

Explanation:



Leave a Reply 1

Your email address will not be published. Required fields are marked *


BKhateib

BKhateib

Verified The answers are correct, in “A” sortedMap is an interface