Opt In (Do Not Edit Here)

Jul 22, 2011

Difference between Variables & Properties

Variables

Properties

Variable is named location in memory in which a value is store

Property represents information that an Object contains.

Can Declared anywhere in the Program

Should be implemented with ‘Property’ Procedure

No ‘GET - SET’ Sections are present, it declared simply using Access Specifier and the Data Type of the Variable

Properties are implemented with ‘GET - SET’ Sections that are used to Retrieve & Set the Data

Syntax:

As

Syntax:

Property As

Get

//statements

End Get

Set(ByVal value As )

//statements

End Set

End Property

Example:

o Dim num As Integer

o Public _name As String

Example:

Public Property name () As String

Get

Return _name

End Get

Set (ByVal value As String)

_name=value

End Set

End Property

About The Author :

Freelancer and IT Engineer
Softwares Developed by Mayur Dighe ImmortalDotNet.WordPress.com

0 comments :

All Rights Reserved. 2014 Copyright SIMPLITONA

Powered By Blogger | Published By Gooyaabi Templates Designed By : BloggerMotion

Top