Value Types:
The .NET Framework includes a large number of built-in types that you can use directly or use to build your own custom types.
Value types directly contain their data, offering excellent performance. However, value types are limited to types that store very small pieces of data. In the .NET Framework, all value types are 16 bytes or shorter.
You can create user-defined types that store multiple values and methods. In object-oriented development environments, a large portion of your application logic will be stored in user-defined types.
Enumerations improve code readability by providing symbols for a set of values.
Reference Types:
Reference types contain the address of data rather than the actual data.
When you copy a value type, a second copy of the value is created. When you copy a reference type, only the pointer is copied. Therefore, if you copy a reference type and then modify the copy, both the copy and the original variables are changed.
The .NET Framework includes a large number of built-in reference types that you can use directly or use to build your own custom types.
Strings are immutable; use the StringBuilder class to create a string dynamically.
Use streams to read from and write to files, memory, and the network.
Use the Catch clause within Try blocks to filter exceptions by type. Close and dispose of nonmemory resources in the Finally clause of a Try block.
Wednesday, February 24, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment