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 — JavaGeneric/Example5.java at main · AvinandanBose/JavaGeneric Expand file tree/ Copy pathExample5.javaMore file actions 21 lines (19 loc) · 740 Bytes / Copy pathExample5.javaFile metadata and controls21 lines (19 loc) · 740 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import java.util.Map; import java.util.NavigableMap; import java.util.TreeMap; public class Example5<T extends Map<? super String, ? super Number > & NavigableMap<? super String, ? super Number >> { T get1(T t1, String s, Number n) { t1.put(s, n); return t1; } public static void main(String[] args) { Example5<TreeMap<String, Number>> e1 = new Example5<>(); TreeMap<String, Number> al1 = new TreeMap<>(); e1.get1(al1, "One", 1); e1.get1(al1, "Two", 2); e1.get1(al1, "Three", 3); e1.get1(al1, "Four", 4); e1.get1(al1, "Five", 5).forEach((k,v) -> System.out.println(k + " " + v)); System.out.println("al = " + al1); } } |
| You are visitor 01402503 — 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. |