- Could more than one class be created for a single project
and if they could be used in different projects?
- Yes – you could create multiple classes and they could
each be used in different future projects. Such reuse is a reason that
OOP is good.
- Is every constructor named new?
- How often are instance variables used?
- In every class – a class without instance variables would
not be very useful
- You said we could get fancy with the class (definition).
What other things could we do with it?
- A class could inherit from other classes. For instance,
you could have a Person class, which would include name, address, birth
date, and another class – Employee which would inherit all of that from
Person, and in addition have things like position, date hired, etc
- How useful are classes?
- How much can really be done with classes?
- Today’s example was really basic (By the way, it was not
the square class putting up msgboxes – that was the Form1). Classes can
be very complex, with many instance variables and methods. Most programs
being developed in the 2000’s use classes.
- Instantiation and what it actually means. Also what
instance means.
- An instance is an object (basically synonyms).
Instantiation means creating the object and filling it with values (in
its instance variables)
- Is there a limit to how many classes one program can have
- Is it possible for a person to start a lab from what we
did at the beginning of the semester and end it with class so that it is
one big lab or form?
- Probably. Can’t say it would be easy to put all of the
topics into one project.
- What is the full meaning behind overloading and how far
can you take it?
- Overloading basically means that a procedure/function
name is used to name more than one chunk of code. The system can determine
which is being called based on the number and types of parameters. I have
seen a dozen versions of the same method name. In Java, it can be taken
to the point of “true polymorphism” in which the version to use is
determined while the program is running, instead of when it is compiled.
- Are we going to have to know how to make a class for the
exam?
- No. I expect there might be Completion, True/False,
Multiple Choice, Short Answer, Valid/Invalid, and/or Following Code
questions, but not Writing Code questions.
- When do you use classes over structures/functions?
- The bigger the project, the more people working on the
project, the more likely it is to be valuable to use classes. The more
you want to reuse code on other projects, that increases the desirability
of using classes. Other languages (e.g. Java) are pure OOP, and have all
code associated with classes. In VB, there is some extra overhead
involved in reusing code in other projects because the IDE must be dealt
with.