T
Thomas G. Marshall
Gary Labowitz coughed up:
That'd be the wrong approach IMHO.
When I teach students, I'm similarly faced with being extremely careful in
my wording. I try to give examples that exploit one issue at a time. In
this case, I'd use something like my example program posted above, but
several incantations of it, slowly growing in size. Top only, then Top &
Bottom. Starting with members of objects, and then moving to statics. In
that order, only because of /this particular/ "overriding or not who belongs
to what" issue we're talking about.
"Thomas G. Marshall"
I guess I have to be more precise. At the point where we are talking
about this resolution issue the students haven't even gotten to
static modifier yet. So, I think what I am saying is correct for
them. However, your three point statement holds one area that I don't
like. "3. ... polymorphized object ..." gives me a problem. Since we
haven't covered static, and I think haven't covered overriding yet
mention of polymorphism isn't useful. So, I still want to default
back to my two statements, let them program a while and see the
results, and then we introduce other notions. The first being static,
the next being inheritance, and then overriding inherited methods to
achieve polymorphism. They are already familiar with "stuctural
polymorphism" due to overloading. Anyway, I'm still struggling to
find the perfect way to introduce all topics simultaneously -- maybe
just pass out the JLS and tell them to memorize it.
That'd be the wrong approach IMHO.
When I teach students, I'm similarly faced with being extremely careful in
my wording. I try to give examples that exploit one issue at a time. In
this case, I'd use something like my example program posted above, but
several incantations of it, slowly growing in size. Top only, then Top &
Bottom. Starting with members of objects, and then moving to statics. In
that order, only because of /this particular/ "overriding or not who belongs
to what" issue we're talking about.