196 Methods Chapter 6 The set of namespaces available in the FCL is quite large. In addition to the namespaces summarized in Fig. 6.6, the FCL includes namespaces for complex graphics, advanced graphical user interfaces, printing, advanced networking, security, multimedia, accessibility (for people with disabilities) and many more. For an overview of the namespaces in the FCL, look up .NET Framework, class library in the help documentation. 6.8 Value Types and Reference Types In the next section, we will discuss passing arguments to methods by value and by reference. To understand this, we first need to make a distinction between types in C#. Data types are either value types or reference types. A variable of a value type contains data of that type. A variable of a reference type, in contrast, contains the address of the location in memory where the data are stored. Value types normally represent single pieces of data, such as int or bool values. Reference types, on the other hand, refer to objects, which can contain many individual pieces of data. We discuss objects in detail in Chapters 8, 9 and 10 (Object-Based Programming, and Object-Oriented Programming parts 1 and 2). C# includes built-in value types and reference types. The built-in value types are the integral types (sbyte, byte, char, short, ushort, int, uint, long and ulong), the floating-point types (float and double) and the types decimal and bool. The built-in reference types are string and object. Programmers also can create value types and reference types. The reference types that programmers can create are classes (Chapter
, interfaces (Chapter
and delegates (Chapter 9). The table in Fig. 6.7 lists the primitive data types, which are building blocks for more complicated types. Like its predecessor languages C and C++, C# requires all variables to have a type before they can be used in a program. For this reason, C# is referred to as a strongly typed language. Type Size in bits Values Standard bool 8 trueor false char 16 ‘u0000′to ‘uFFFF’ (Unicode character set) byte 8 0 to 255 (unsigned) sbyte 8 -128 to +127 short 16 32,768 to +32,767 ushort 16 0 to 65,535 (unsigned) int 32 2,147,483,648 to 2,147,483,647 uint 32 0 to 4,294,967,295 (unsigned) long 64 9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 ulong 64 0 to 18,446,744,073,709,551,615 (unsigned) decimal 128 1.0 x 10-28 to 7.9 x 1028 float 32 (IEEE 754 floating point) 1.5 10-45 to 3.4 1038 Fig. 6.7 C# built-in data types. (Part 1 of 2.)
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.