1 / 6

Visual Basic.NET – Collection

Visual Basic.NET – Collection. Rully Yulian MF MCAD,MCPD,MCT,MVP VB.NET Independent IT Trainer - Application Developer http://www.yulianmf.com rully@yulianmf.com. Overview. Array ArrayList Queue Stack. Array.

mahola
Download Presentation

Visual Basic.NET – Collection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Basic.NET – Collection Rully Yulian MF MCAD,MCPD,MCT,MVP VB.NET Independent IT Trainer - Application Developer http://www.yulianmf.com rully@yulianmf.com

  2. Overview • Array • ArrayList • Queue • Stack

  3. Array • Merupakan struktur data yang menyimpan koleksi data dengan tipe data yang sama • Tiap elemen memiliki nilai indeks • Zero based index untuk lower bound • Array 1D, 2D, multi dimension array • Dim intArr1() As Integer = {} • Dim intArr2() As Integer = New Integer() {} • Dim intArr3() As Integer = {1, 2, 4} • Dim intArr4() As Integer = New Integer() {1, 2, 3} • Dim strArr1(2) As String • Dim strArr2() As String = New String(2) {} • Dim strArr3() As String = New String(2) {"a", "b", "c"} • Redim [Preserver] arrayName (NewUpperBound)

  4. ArrayList • Merupakan object based collection • Terdapat didalam namespace System.Collections • Memiliki sifat Resizable dan Dynamic dalam hal ukuran kapasitas • Memungkinkan terjadinya proses Boxing and Unboxing • Hanya dapat digunakan untuk collection satu dimensi tidak seperti halnya Array. • Dim guitars As New ArrayList() guitars.Add(“PRS") guitars Insert(1, “Washburn") guitars.Remove(“PRS")

  5. Queue • Merupakan Collection of Objects • Terdapat didalam namespace System.Collection namespace • Memiliki sifat FIFO (First In First Out) • Memungkinkan terjadinya proses Boxing and Unboxing • Dim myWishList As New Queue() myWishList.Enqueue(“MPV Car") myWishList.Enqueue(“Mansion") myWishList.Dequeue()

  6. Stack • Merupakan Collection of Objects • Terdapat di dalam namespace System.Collection • Memiliki sifat LIFO (Last In First Out) • Memungkinkan terjadinya proses Boxing and Unboxing • Dim myWishList As New Stack() myWishList.Push(“MPV Car") myWishList.Push(“Mansion") myWishList.Pop()

More Related