カテゴリー
Visual Basic

Visual Basic 自動実装Property

Imports System

Module Program
    Class elem
        Public Property Ope As String
        Dim a As String = _Ope

        Public Property Lve As Integer
        Dim b As Integer = _Lve

    End Class
    Sub Main(args As String())

        Dim a As New elem
        a.Ope = "100"
        a.Lve = 0

        Dim b As New elem With {.Ope = "+", .Lve = 1}

        Dim c As New elem With {.Ope = "*", .Lve = 2}

        Dim elemstack As New Stack

        Dim w As elem
        elemstack.Push(a)
        elemstack.Push(b)
        elemstack.Push(c)
        Do While elemstack.Count > 0
            w = elemstack.Pop
            Console.Write(w.Ope + ", ")
            Console.WriteLine(w.Lve)
        Loop

        Console.WriteLine("Hello World!")
    End Sub
End Module

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

inserted by FC2 system