LinkedMap HashMap Java

Map<Float,String> linkedHashMap = new LinkedHashMap<Float, String>();
 
 linkedHashMap.put(14.f, "text");
 linkedHashMap.put(13.f, "text");
 linkedHashMap.put(10.f, "text");
 linkedHashMap.put(11.f, "text");
 linkedHashMap.put(2.f, "text");
 linkedHashMap.put(3.f, "text");
 linkedHashMap.put(1.f, "text");
 linkedHashMap.put(7.f, "text");
 linkedHashMap.put(23.f, "text");
 
	for (Entry<Float,String> entry : linkedHashMap.entrySet()) {
		System.out.println(entry.getKey());
	}
14.0
13.0
10.0
11.0
2.0
3.0
1.0
7.0
23.0
 
Map<Float,String> hashMap = new HashMap<Float, String>();
 
 hashMap.put(14.f, "text");
 hashMap.put(13.f, "text");
 hashMap.put(10.f, "text");
 hashMap.put(11.f, "text");
 hashMap.put(2.f, "text");
 hashMap.put(3.f, "text");
 hashMap.put(1.f, "text");
 hashMap.put(7.f, "text");
 hashMap.put(23.f, "text");
 
 
 
	for (Entry<Float,String> entry : hashMap.entrySet()) {
		System.out.println(entry.getKey());
	}
// key :
1.0
14.0
3.0
13.0
2.0
7.0
11.0
23.0
10.0
This entry was posted in Android Examples Code, Array,List,Collections and tagged . Bookmark the permalink.


Comments are closed.

2,283 views