Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以解释一下这段代码的作用吗?
Kartenstapel stapel1 = new Kartenstapel(new Karte[] { });
*Kartenstapel 和 Karte 是类。
我只有一个猜测,但不确定。它是一个创建的空对象吗?
谢谢你的笔记。
这意味着Karte创建一个空数组并将其作为参数提供给Kartenstapel构造函数,而构造函数又会创建一个Kartenstapel对象。
Karte
Kartenstapel
您正在创建一个 KartenStapel 对象,传入一个包含零元素的 Kartes 数组。