Classes and Objects

Just as the concepts of structured programming once revolutionized software development, object-oriented programming (OOP) has revolutionized it again. Objects, in this sense, are software modules that group together all the data items and procedures necessary to represent some real or abstract entity. Suppose, for example, that you want to write programs that manage apartment leases. Associated with each lease are

  • Certain data items, such as the property location, the leaseholder’s name, the monthly rent, the start date, the end date, and so forth. These are the properties of the lease.

  • Certain activities, such as initiating a new lease, printing it, receiving rent, creating an overdue notice if the rent is late, canceling the ...

Get Faster Smarter Beginning Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.