O'Reilly logo

MCSD Certification Toolkit (Exam 70-483): Programming in C# by Gerry O'Brien, Vincent Varallo, Rod Stephens, Tiberiu Covaci

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Using Types

What You Will Learn in This Chapter

  • Converting values from one data type to another
  • Widening, narrowing, implicit, and explicit conversions
  • Casting
  • Converting values with help methods and classes
  • Manipulating strings
  • Formatting values

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=1118612094 on the Download Code tab. The code is in the chapter 04 download and individually named according to the names throughout the chapter.

Chapter 3, “Working with the Type System,” introduces the C# type system. It explains how to create value types (data structures and enumerations) and reference types (classes). It also explains encapsulation, and generic types and methods. This chapter continues the discussion of types by explaining how to convert between different types, such as converting an int or float into a string for display to the user. It explains how to use types to interact with unmanaged code. It also explains how to manipulate strings to perform such operations as determining whether a string begins with a given prefix and extracting substrings.

Table 4-1 introduces you to the exam objectives covered in this chapter.

Table 4-1: 70-483 Exam Objectives Covered in This Chapter

ObjectiveContent Covered
Create and Use TypesCreate types. This includes boxing and unboxing value types, converting and casting between value types, handling dynamic types, and ensuring interoperability ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required