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/Example7.java at main · AvinandanBose/JavaGeneric Expand file tree/ Copy pathExample7.javaMore file actions 53 lines (37 loc) · 1021 Bytes / Copy pathExample7.javaFile metadata and controls53 lines (37 loc) · 1021 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 import java.io.Serializable; interface A1<T> { public T get(T a); } interface B1<T> { public T get(T b); } class C1<T> implements A1<T>, B1<T> { public T get(T c) { return c; } } public class Example7<T extends A1<? super Number> & B1<? super Number>> { public static void main(String[] args) { A1<Number> a = new A1<Number>(){ @Override public Number get(Number a) { return a; } }; System.out.println(a.get(1)); B1<Object> b = new B1<Object>(){ @Override public Object get(Object b) { return b; } }; System.out.println(b.get(2)); B1<Serializable> b2 = new B1<Serializable>() { @Override public Serializable get(Serializable b) { return b; } }; System.out.println(b2.get(3)); } } |
| 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. |