Data Types and Access Specifiers in Visual Basic .NET

In this article, I will explain you about Data Types and Access Specifiers in Visual Basic .NET.
  • 1023

In this article, I will explain you about Data Types and Access Specifiers in Visual Basic .NET

Data Types


Visual Basic .NET Data Types, their description, type and Size in Bytes are summarized in this table below.

Data Type

Description

Type

Size in Bytes

Char

16-bit Unicode characters

System.Char

2

Integer

32-bit signed integer

System.Int32

4

Double

64-bit floating point variable

System.Double

8

Byte

8-bit unsigned integer

System.Byte

1

Long

64-bit signed integer

System.Int64

8

Short

16-bit signed integer

System.Int16

2

Single

32-bit floating point variable

System.Single

4

String

Non-Numeric Type

System.String

Varies

Date

 

System.Date

8

Boolean

Non-Numeric Type

System.Boolean

2

Object

Non-Numeric Type

System.Object

4

Decimal

128-bit floating point variable

System.Decimal

16


Access Specifiers

They describes as the accessibility scope of a variable, method or a class. By using access specifiers we can control the scope of the member object of a class. Access specifiers were used  for providing security of our applications. In Visual Basic .Net there are five access specifiers and they are as follows:

Public: It have no restriction on accessibility. We can use the public members from any were inside the class or outside the class.

Private: Their accessibility scope is limited to only inside the class in which they are declared. We can't access the Private members from outside the class and it is the least permissive access level.

Protected: The protected members have scope of accessibility within the class and classes derived(Inherited) from that class.

Friend: Friend members have the accessibility scope from the same assembly and program that contain their declarations.

Protected Friend:
It behave like both protected and friend access specifiers. We can access the protected friend member from anywhere in same assembly and the classes inherited from the same class.

Summary

I hope this article help you to understand about Data Types and Access Specifiers.

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.