Skip to Content
Head First C#, 3rd Edition
book

Head First C#, 3rd Edition

by Jennifer Greene, Andrew Stellman
September 2013
Beginner
1098 pages
31h 24m
English
O'Reilly Media, Inc.
Content preview from Head First C#, 3rd Edition

Chapter 4. Types and References: It’s 10:00. Do you know where your data is?

image with no caption

Data type, database, Lieutenant Commander Data... it’s all important stuff. Without data, your programs are useless. You need information from your users, and you use that to look up or produce new information to give back to them. In fact, almost everything you do in programming involves working with data in one way or another. In this chapter, you’ll learn the ins and outs of C#’s data types, see how to work with data in your program, and even figure out a few dirty secrets about objects (pssst...objects are data, too).

The variable’s type determines what kind of data it can store

image with no caption

There are a bunch of types built into C#, and each one stores a different kind of data. You’ve already seen some of the most common ones, and you know how to use them. But there are a few that you haven’t seen, and they can really come in handy, too.

Types you’ll use all the time

It shouldn’t come as a surprise that int, string, bool, and double are the most common types.

  • int can store any whole number from –2,147,483,648 to 2,147,483,647.

    Note

    A whole number doesn’t have a decimal point.

  • string can hold text of any length (including the empty string "").

  • bool is a Boolean value—it’s either true or false.

  • double can store real numbers from ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene
Head First C#, 2nd Edition

Head First C#, 2nd Edition

Andrew Stellman, Jennifer Greene
Head First C#

Head First C#

Andrew Stellman, Jennifer Greene
Head First C

Head First C

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781449358846Errata Page