// Some the differences in generic types between JVM and .NET bytecode // sestoft@itu.dk * 2010-02-11 class GenericMain { public static void main(String[] args) { GenericClass gs = new GenericClass(); Student s1 = gs.MethodA(); Student s2 = gs.MethodB(); } public static T Method(T x, T y) { return Math.random() > 0.5 ? x : y; } } class GenericClass { public T ft; public U fu; public T[] fts; public T MethodA() { return ft; } public T MethodB() { return (T)(new Person()); } } class Person { } class Student extends Person { }