Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在堆栈中使用类(用户控件)_C#_Int_Private - Fatal编程技术网

C# 在堆栈中使用类(用户控件)

C# 在堆栈中使用类(用户控件),c#,int,private,C#,Int,Private,我很抱歉,如果这个问题。所以我们正在学习用户控件,这段代码突然出现了 private Stack<MyFirstUserControl1> _myControls = new Stack<MyFirstUserControl1>(); private int _controlsInstantiated = 0; private Stack\u myControls=new Stack(); 私有int_controlsInstantiated=0; 可以在堆栈中使用

我很抱歉,如果这个问题。所以我们正在学习用户控件,这段代码突然出现了

private Stack<MyFirstUserControl1> _myControls = new Stack<MyFirstUserControl1>();
private int _controlsInstantiated = 0; 
private Stack\u myControls=new Stack();
私有int_controlsInstantiated=0;

可以在堆栈中使用类吗?有人能解释一下吗?没有问题我肯定

只不过是一个后进先出的后进先出队列,它只是一个可以根据后进先出推送和弹出的对象列表/集合,在这种情况下,它是一个类型为
MyFirstUserControl1

的实例列表,它只是一个可以根据后进先出推送和弹出的对象列表/集合,在这种情况下,它是一个类型为
MyFirstUserControl1

Stack
的实例列表,这意味着集合将是
MyFirstControl1
类型的,这意味着集合将是
MyFirstControl1
类型

是。事实上,您必须使用一个(或一个结构)。:)对事实上,您必须使用一个(或一个结构)。:)