List<T>.IList.Add(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將項目加入至 IList。
virtual int System.Collections.IList.Add(System::Object ^ item) = System::Collections::IList::Add;
int IList.Add (object item);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (item As Object) As Integer Implements IList.Add
參數
傳回
插入新項目的位置。
實作
例外狀況
item
所屬類型無法指派給 IList。
備註
如果 Count 小於 Capacity,則這個方法是 O (1) 作業。 如果需要增加容量以容納新的元素,這個方法會變成 O (n) 作業,其中 n 是 Count。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應