Chapter 8: Understanding Values and References


Chapter 8

Understanding Values and References

After completing this chapter, you will be able to:

  • Explain the differences between a value type and a reference type.

  • Modify the way in which arguments are passed as method parameters, by using the ref and out keywords.

  • Box a value by initializing or assigning a variable of type object.

  • Unbox a value by casting the object reference that refers to the boxed value.

In Chapter 7, “Creating and Managing Classes and Objects,” you learned how to declare your own classes and create objects by using the new keyword. You also saw how to build an object by using a constructor. In this chapter, you will learn about the very different characteristics of the primitive types (such as int) and class types (such as Circle).




Microsoft Visual C# 2005 Step by Step
Microsoft® Visual C#® 2005 Step by Step (Step By Step (Microsoft))
ISBN: B002CKYPPM
EAN: N/A
Year: 2005
Pages: 183
Authors: John Sharp

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net