public class MyItemType
{
................
}
class MyStack
{
LinkedList<MyItemType> ourList = null;
MyItemType top = null;
................
public MyItemType Pop()
{
if (IsEmpty())
{
return null;
}
else
{
MyItemType temp = ourList.Last; // <--- issue here
ourList.RemoveLast();
return temp;
}
}
................
}
错误: 错误2无法将类型'System.Collections.Generic.LinkedListNode'隐式转换为'Ex1.MyItemType'