O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

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

4. Introduction to Classes, Objects, Methods and strings

Nothing can have value without being an object of utility.

—Karl Marx

Your public servants serve you right.

—Adlai E. Stevensonl

Objectives

In this chapter you’ll:

• Declare a class and use it to create an object.

• Implement a class’s behaviors as methods.

• Implement a class’s attributes as instance variables and properties.

• Use string objects.

• Call an object’s methods to make them perform their tasks.

• Understand the differences between instance variables of a class and local variables of a method.

• Use a constructor to initialize an object’s data.

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