VB.Net - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

VB.Net Modifiers

VB.Net Modifiers

shape Description

Modifiers are used to represent the scope of the code.A modifier is a keyword placed in a class, method or variable declaration that changes how it operates.Public, Private, Protected, Friend, Protected Friend, etc., indicate the access level of a programming element like a variable, constant, enumeration or a class.Following are different available modifiers in vb.net.

shape Example

Following is an example which describes how public modifier will works. [vbnet] Imports System Public Class Example Shared Sub Main() Dim a As Long Dim b As Integer Dim c As Double a = 10 b = 20 c = a * b Console.WriteLine("a = {0}", a) Console.WriteLine("b = {0}", b) Console.WriteLine("c = {0}", c) Console.ReadLine() End Sub End Class [/vbnet] Output When compile the code following is the output will be generated.

Summary

shape Points

  • ByRef Specifies that parameter is passed by reference
  • The scope of public modifier is global.