|
|
This quiz will be given
on 07 October!!!
Reason for quizzes.
A course like CS100 uses a lot of terminology and introduces many new
concepts. Typically, the terminology and concepts are used from the day
they are introduced onward. If you don't learn them soon after they are
introduced, you can't understand later lectures and material. So, each
quiz alerts you to what is important for you to learn at that time (and
forces you, hopefully, to learn it). We hope that you don't only superficially
learn it but grok it. (If you don't know
what grok means, bring up ProgramLive (the CD), open the glossary, and
look at the entry for grok.
For quiz 03, you have to know the following:
- Frame for a method call. Given a method call, be able to draw a frame
for the call. Read Sec. 2.7 and Fig. 2.8, which shows the format of
a frame for a method call. Practice drawing such frames given a call.
- Apparent and real types. Read Sec. 4.2.1. You have to be able to repeat
the following, and, given an example of classes and variables, you have
to be able to say what the apparent and real types are.
The apparent class of a variable x is
the class with which it is declared. It is a syntactic property, which
can be determined without executing a program.
The real class of a variable x is the
class of the folder whose name x currently contains. It is a semantic
property; it depends on what is in x during execution, and this can
change.
Whether one can write x.<component-name> or x.<component-name>(...)
depends on the apparent class of x. Only components that are declared
in or inherited in class x can be referenced. This is a syntactic
property. Whether such a reference is legal can be determined by the
compiler, without executing the program.
Suppose x.<component-name>(...) is legal. Which method is called
is determined by the real type of x. This is a semantic property;
it depends on what is in x during execution of the program, and this
can change.
The way to learn these key concepts is to read them and then write
them. Practice drawing frames for calls. Practice writing the definitions.
|