溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

VB.NET對(duì)象列表的示例分析

發(fā)布時(shí)間:2021-12-02 13:59:09 來源:億速云 閱讀:115 作者:小新 欄目:編程語言

小編給大家分享一下VB.NET對(duì)象列表的示例分析,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

第一步步是要?jiǎng)?chuàng)建一個(gè)同用列表,你可以從多種途徑獲取數(shù)據(jù),但是最簡單的方法是添加。文本中,我們會(huì)編寫代碼以便為舉例中的集來分類。因此,下面我們就來講講創(chuàng)建集的代碼。首先,我需要一個(gè)能代表集中的bottle的對(duì)象。為此而編寫的代碼是完全符合標(biāo)準(zhǔn)的,而且事實(shí)上,vb.net 2008 express intellisense會(huì)為你寫好大部分的代碼。以下是我的VB.NET對(duì)象列表:

public class bottle "internalproperties"public property brand() as string  public property name() as string  public property category() as string  public property size() as decimal  public sub new( _  end sub  end class  為了創(chuàng)建集,我需要添加項(xiàng)目:  dim cabinet as list(of bottle) = _ "new list(of bottle)cabinet.add(new bottle( _  "castle creek", _  "uintah blanc", _  "wine", 750))  cabinet.add(new bottle( _  "zion canyon brewing company", _  "springdale amber ale", _  "beer", 355))  cabinet.add(new bottle( _  "spanish valley vineyards", _  "syrah", _  "wine", 750))  cabinet.add(new bottle( _  "wasatch beers", _  "polygamy porter", _  "beer", 355))cabinet.add(new bottle( _  "squatters beer", _  "provo girl pilsner", _  "beer", 355))

所有的這些都是vb.net1.0中的標(biāo)準(zhǔn)代碼。但是,要通過定義我們自己的bottle對(duì)象來注明。

以上是“VB.NET對(duì)象列表的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI