From 576e7b3f01e6c9f1493b326856975da29a6338e7 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sun, 20 May 2012 15:17:23 +0200 Subject: [PATCH] tests: generics --- tests/Generics1.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/Generics1.java diff --git a/tests/Generics1.java b/tests/Generics1.java new file mode 100644 index 0000000..4e3d262 --- /dev/null +++ b/tests/Generics1.java @@ -0,0 +1,21 @@ +package tests; + +public class Generics1 implements Cmp { + public Integer a = new Integer(0x1337); + public int cmpto(Integer o) { + return a.intValue() - o.intValue(); + } + + public static Cmp sb = new Generics1(); + + public static void main(String []args) { + Generics1 foo = new Generics1(); + System.out.printf("0x%08x\n", foo.cmpto(0x666)); + System.out.printf("0x%08x\n", sb.cmpto(0x666)); + } +} + +interface Cmp +{ + int cmpto(T o); +} -- 2.25.1