Difference between Dim and Private

前端 未结 2 1457
难免孤独
难免孤独 2020-12-14 15:34

What is the difference between Dim and Private in VB.NET?

2条回答
  •  眼角桃花
    2020-12-14 16:03

    Dim & Private are two different things. Dim is used to declare variables and allocate memory space. Private is used as access modifier for the variable, on how your variable should be accessed. If you didn't specify an access modifier on a variable it will be Private by default. You can optionally omit Dim by declaring the variable after the access modifier.

提交回复
热议问题