Friday, February 17, 2012

c# Type Safety

c sharp is type safety language 
simple definition
"well typed program-never go wrong"   

C# is primarily a type-safe language, meaning that types can interact only through
protocols they define, thereby ensuring each type’s internal consistency. For instance,
C# prevents you from interacting with a string type as though it were an
integer type.
More specifically, C# supports static typing, meaning that the language enforces
type safety at compile time. This is in addition to dynamic type safety, which the .NET
CLR enforces at run time.

Type safe code access only the memory location ,It is authorized to access.
It cannot read value from another private fields. Its access types only in well defined, allowable ways

Reference book c# 4.0 in a nutshell

No comments:

Post a Comment