【发布时间】:2012-09-24 08:34:27
【问题描述】:
我读到以下格式属于参数多态性,但我们可以将它归类为运行时或编译时多态性吗?
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()
{...}
}
【问题讨论】:
-
@Guillaume 很棒的短文。我在找 E.L. 的东西。作为参考。
标签: c# oop generics polymorphism