Object Based Manipulation

.NET is object oriented to the core. In fact, even ordinary variables are really full-fledged objects in disguise. This means that comman data types types have the built-in smart to handle basic operations. Even better, it means you can manipulate strings, dates, and numbers in the same way in C# or VB language.
As an example, every type in the .NET class library includes a ToString() method. The default implanation of this methos returns the class name. In simple variables, a more useful result is returned : the string representation of the given variables.
The following code snippet demonstrates how to use the ToString() method with an integer:
string VMyString;
int vMyInteger=100;
vMyString=vMyInteger.ToString();

2 comments: