代码1
using System;
class A<B>{
}
class ASub<T>:A<B>{
public T fun(T t){
return t;
}
}
class B{
public int a = 5;
}
public class Fanxing{
public static void Main(){
Console.WriteLine("hello word");
ASub<B> ab = new ASub<B>();
B b = new B();
B b2 = ab.fun(b);
Console.WriteLine(b2.a);
}
}
代码2
using System;
class A<B>{
}
class ASub:A<B>{
public B fun(B t){
return t;
}
}
class B{
public int a = 5;
}
public class Fanxing{
public static void Main(){
Console.WriteLine("hello word");
ASub ab = new ASub();
B b = new B();
B b2 = ab.fun(b);
Console.WriteLine(b2.a);
}
}