Searching...

Translate

How C# Relates to the .NET Framework

ü How C# Relates to the .NET Framework

   Although C# is a computer language that can be studied on its own, it has a special relationship to its runtime environment, the .NET Framework. The reason for this is twofold.

1.     C# was initially designed by Microsoft to create code for the .NET Framework.
2.     The libraries used by C# are the ones defined by the .NET Framework.

   Thus, even though it is theoretically possible to separate C# the language from the .NET environment, in practice the two are closely linked. Because of this, it is important to have a general understanding of the .NET Framework and why it is important to C#.


*   2.1 introducing C# Data Types (Including Boxing – Unboxing)

   C# suitable for a wide range of applications. You can create variables of any of these types, and you can specify constants of each type, which in the language of C# are called literals.

v Why Data Types Are Important

   Data types are especially important in C# because it is a strongly typed language. This means that all operations are type-checked by the compiler for type compatibility. Illegal operations will not be compiled. Thus, strong type-checking helps prevent errors and enhances reliability.


   To enable strong type-checking, all variables, expressions, and values have a type. There is no concept of a “type less” variable, for example. Furthermore, a value’s type determines what operations are allowed on it. An operation allowed on one type might not be allowed on another.

0 comments:

Post a Comment

Subscribe us