相关疑难解决方法(0)

泛型运行时或编译时多态吗?

我读到以下格式属于参数多态,但是我们可以将它分为一个,运行时或编译时多态吗?

public class Stack<T>
{  // items are of type T, which is known when we create the object
   T[] items;  
   int count;  
   public void Push(T item)    {...}
   //type of method pop will be decided when we create the object  
   public T Pop() 
   {...} 
 }  
Run Code Online (Sandbox Code Playgroud)

c# oop generics polymorphism

9
推荐指数
1
解决办法
6093
查看次数

标签 统计

c# ×1

generics ×1

oop ×1

polymorphism ×1