GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/MapSort/src/com/hmkcode/Test.java at master · xchleoit/Java Expand file tree/ Copy pathTest.javaMore file actions 28 lines (19 loc) · 621 Bytes / Copy pathTest.javaFile metadata and controls28 lines (19 loc) · 621 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 package com.hmkcode; import java.util.HashMap; import java.util.Map; public class Test { public static void main(String[] args){ Map map = new HashMap(); //*value Class should implements the Comparable interface //*String implements Comparable by default. map.put("Z", "3"); map.put("D", "4"); map.put("A", "1"); map.put("B", "2"); map.put("F", "6"); map.put("E", "5"); System.out.println("Unsorted Map: "+map); System.out.println("Sorted Map By Values: "+MapSort.sortByValue(map)); System.out.println("Sorted Map By Keys: "+MapSort.sortByKey(map)); } } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |