4 Introduction to Classes, Objects, Methods and strings

Objectives

In this chapter you’ll:

  • Begin programming with the object-oriented concepts introduced in Section 1.6.

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

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

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

  • Understand what local variables of a method are and how they differ from instance variables of a class.

  • Use validation to prevent bad data from being stored in an object.

  • Understand the software engineering benefits of private instance variables and public access methods.

  • Use properties to provide a friendlier notation for storing and retrieving data.

  • Use a constructor to initialize an object’s data when the object is created.

  • Use type decimal for precise monetary amounts and calculations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset