我读到以下格式属于参数多态,但是我们可以将它分为一个,运行时或编译时多态吗?
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)