Sponsored Ad

Thursday, September 24, 2009

The Object Type in C#

Many programming languages and c# hierarchies accommodate a basis type, from which all added datatypes are derived. C# and .NET are no exception. In C#, the article blazon is the ultimate ancestor blazon from which all added built-in and user - authentic types are derived. This is a key feature of C# that distinguishes it from both Visual Basic 6.0 and C++, although its behavior actuality is similar to Java. All types around acquire ultimately from the System.Object class. This feature you can use for two purposes.
  • You can use an object reference to bind to an object of any particular subtype. “ Operators and Casts, ” you will see how you can use the object type to box a value object on the stack to move it to the heap. object references are also useful in reflection, when code must manipulate objects whose specific types are unknown. This is similar to the role played by a void pointer in C++ or by a Variant data type in VB.
  • The object type implements a number of basic, general - purpose methods, which include Equals() , GetHashCode() , GetType() , and ToString(). Responsible user - defined classes may need to provide replacement implementations of some of these methods using an object - oriented technique known as overriding in “ Inheritance. ” When may charge to accommodate backup implementations of some of these methods application an article - oriented address accepted as cardinal in Inheritance.

0 comments:

Post a Comment

Sponsored Ad

Website Update

Followers