My Profile Sign In Register
Links Message Center File Manager Members Hall Of Fame Site Configuration
The Chapter 1 :Lesson 1 for MCTS 70-536
26 Aug 2009
Posted By: initiotech Member Level: Silver Points: 10
Chapter 1: Fundamentals of .NET Framework
Lesson 1: Using Value Types
The objectives of this Lesson is to undertand
* Chosing the most efficent builtin Value Type
* Declaring Value Types
* Creating your own types
Understanding the concepts of Value Types is very simple.
Value Types are variables that directly store the value rather than storing only
the refernce to the value stored somewhere else in the memory.
The Value types are Stored in a Memory Area called stack
The stack is a memory area where the runtime can easily create,read,update and remove value quickly without any performance stress.
All primarily numeric and Boolean values are Value Types.
Some of the Built-In value types are
There are many more Value Types in the .NET Framework.
Declaring of value types are very simple
Dim num as Integer
Value Type Variables will never hold a Null Value.
If you need a Value Type variable to hold a null Value we use NullableTypes
Nullable num=new Nullable();
Dim num as Nullable(Of Integer)=Nothing
Creating User-Defined Value Type
To create a User-Defined Value Type in .NET we need to create a Structure
As a matter of Fact Value Types like int,single,DateTime,Point are all Structures.
To create our own Structure
Dim height as Integer
Dim width as Integer
One more Form of an Value Type is an Enumerator
Enums are used to provide a list of options for developers to use in their Class.
The Following example creates an Enum for PaymentMode
Enum PaymentMode as Integer
Value Types are those types that store values on the Stack.
DataTypes like int,single,float,DateTime,Point etc are Value Types
Custom Value Types can be created using Structures
List of Options for developers can be made by using Enumerators
Note:If you want any assistance about other MCTS 70-536 contents PM me or join my community.
No responses found. Be the first to respond and make money from revenue sharing program.
You must Sign In to post a response.