Skip to main content Accessibility help
×
Hostname: page-component-7479d7b7d-68ccn Total loading time: 0 Render date: 2024-07-13T00:24:25.178Z Has data issue: false hasContentIssue false

12 - Objects and Classes – Objects Are in a Class By Themselves

Published online by Cambridge University Press:  05 June 2012

Jim McKeown
Affiliation:
Dakota State University
Get access

Summary

VB Quip

But what is it good for? – an engineer at the Advanced Computing Systems Division of IBM, commenting on the microchip in 1968

Think of objects as tools. Better yet, think of them as building blocks. Imagine how hard a job would be if you had to create everything from scratch every time. Say you wanted to build a table. First, you'd need to make an axe to cut down the tree. Then you'd have to make a saw to cut the wood. You'd have to make your own nails to piece together the table, but that's only after you made your own hammer so you could pound the nails. Programming is like that sometimes – OK, usually. And it was certainly that way years ago. Everything was done from scratch and very little was reusable. However, there's been some progress since then. You saw reusable code when you learned procedures and functions. Objects and classes are that way, but on a grander scale. The controls in the Toolbox are objects, each specially created for a specific task. They're tools and, without them, development would be much tougher, and a whole lot less fun. Classes are code that defines an abstract data type – it's a thing, and the developer provides a description of it and determines how it can be used. This chapter shows you how to create objects with your code and how to define and use classes.

Type
Chapter
Information
Programming in Visual Basic 2010
The Very Beginner's Guide
, pp. 475 - 514
Publisher: Cambridge University Press
Print publication year: 2010

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×