Workshop
The Workshop is designed to help you anticipate possible questions, review what you've learned, and get you thinking about how to put your knowledge into practice. The answers to the quiz are in Appendix A, "Answers to Quizzes/Exercises."
Quiz
To create objects, you must first create a template. This template is called a:
One of the primary benefits of object-oriented programming is that objects contain both their data and their code. This is called:
With static classes, public variables and routines are always available to code via the static class in other modules. Is this true with public variables and routines in classes?
True or False: Each object derived from a class has its own set of class-level data.
What must you do to create a property that can be read but not changed by client code?
What is the best way to store the internal value of a property within a class?
Which is generally superior, early binding or late binding?
What is the best way to release an object you no longer need?
Exercises
Add a new property to your class called DropsInABucket. Make this property a Long, and set it up so that client code can read the property value but not set it. Finally, add a button to the form that, when clicked, prints the value of the property to the Output window. When this is working, modify the code so that the property always returns 1,000,000.
Add a button to your form that creates two object variables of type clsMyClass(). Use the new keyword to instantiate a new instance of the class in one of the variables. Then set the second variable to reference the same object and print the contents of the Height property to the Output window.