Basic Concepts about Object Orientation (a quiz)
One of the most tricky parts to learn Object Orientation is the concept of classification.
The task of separating entities of the real word in groups and then enumerating the
characteristics of each group seems quite simple for experienced programmers but could be messy
for novice students. The discussion about the fundamentals of classification is very important
to establish a baseline about what are classes. A clean explanation about this subject
is a challenge for the teachers and the fluency about the OO terminology is the first duty for
absolute beginners in Java or any other object oriented programming language. This test is not
closed to Java - it was created to be independent of programming languages.
The audience: this test could be useful for teachers interested
in offer their pupils a revision material and also to interchange ideas about how to enhance the
OO teaching methodologies. The students of introductorial classes about Java and OO could
check their knowledge and discuss variations about the answers. The feedback from the students brainstorm
and also from the teachers usage of this material is the most valuable result I can expect from
this text. The questions below are the result of a continuous effort in order to facilitate
the learning of the basic concepts of classification. If you remember an amazing question -
the one that helped you to figure out the idea of classes, objects and its relationships,
post your comments on the bottom of this page.
This section presents a set of questions about classification. Some questions refers to controversial
subjects and could let a student to spend hours thinking about that. DonÂ´t worry if some questions are not
obvious - it is absolute normal on the first time you think about concepts on real world objects
and their modelling in programming languages. The questions are presented in the context of the
programming languages but the classification concepts are nor obvious neither inspired in the computing. The
classification are an old concern of the human thinking and motivates researches in other areas
such as Linguistics, Philosofy and Computer Science. The reading of classification theories in those
diverse study fields is a source of inspiration and I recomend you to talk about that with your teacher and
with your friends. Take all the time you need to complete this test, but resist the urge to peek at
the answers until you finish. The test begins now.
Mark ( T )rue or ( F )alse in the following assertions
about the pictures:
- Picture a represents a person ( ).
- Picture b represents a person ( ).
- Picture c represents a person ( ).
- Picture d represents a person ( ).
- Picture e represents a person ( ).
If you group the pictures above, based on the characteristics of the represented objects, how many groups
will you create? Why?
Why didnÂ´t you classify picture e as a person, if eyes are part of a person?
Why didnÂ´t you classify picture d as a person, if a person could have a car?
Mark ( T )rue or ( F )alse in the following assertions about the pictures:
- Picture a represents a vehicle ( ).
- Picture b represents a vehicle ( ).
- Picture c represents a vehicle ( ).
- Picture d represents a vehicle ( ).
- Picture e represents a vehicle ( ).
If you group the pictures above, based on the characteristics of
the represented objects, how many groups will you create? Why?
If you agree all the pictures above represent vehicles, why can we separate
these figures in different groups?
What is a class?
What is a subclass?
What is a superclass?
If you found a vehicle industry, what kind of products it will produce? Each vehicle produced by your
industry will represent a class or an object?
Can I say picture (c) is an airplane and also a vehicle?
A vehicle can have different formats? What is polymorphism?
What is inheritance?
Can I say that the vehicle (c) flies? And can I
say that the plane (c) flies? What is casting?
If you group the words of the picture above, how many groups will you create? Why?
What words compose each group? What is the meaning of each group you created?
What is a method?
What is a member of a class?
Can you manipulate the internal pieces of the motor of a moving vehicle? Can you touch your own heart? Why not?
Supposing you have wife, son and a car, answer the questions below using ( Y )es
or ( N )o:
- A stranger can sing a song for you without your permission? ( ).
- Your son can watch your TV without your permission? ( ).
- A stranger can drive your car without your permission? ( ).
- Your wife can drive your car without your permission? ( ).
What is the difference among public, protected and private members of a class?
How can you avoid a stranger of driving your car without your permission?
What is encapsulation?
What are package methods?
Can you change the format of your car wheels? What are constant members of a class?
Draw an image for each of these classes: love, beauty and geometry.
Did you have succes trying to draw the above classes? Why canÂ´t you draw an image for the class love?
What are the differences between concrete and abstract classes?
What characteristic is shared by a bee, a plane and a cloud?
What is an interface?
Can you imagine a superclass for modelling bees, planes and clouds? What kind of problems could occur when
we group so different objects in a unique model? Give an alternative to avoid such problems.
Quick review: give a one phrase definition to the terms below:
- Class Hierarchy
Watch the picture below in order to answer the further questions:
Well, done - here comes the answers:
Click here to see the suggested answers.
The questions above compose a basic checklist I use to assess the learning rate of my students
at the end of the semester. I usually use that test on the first or second semester
of graduation courses. The test doesnÂ´t have a score itself and it serves only to review some concepts and also to detect knowledge deficiencies. If you find the questions
are easy, congratulations, you are ready to go on to the more sophisticated subjects - such as
Software Design &
If you have doubts about the concepts here presented, donÂ´t give up - just read your book again and
ask your teacher and colleagues about that. Object Orientation and classification are not trivial
subjects and you donÂ´t have to underestimate or superestimate them - you just have to understand
them as the begining of your learning about Software Design.
See you on the next test.
- Object-Oriented Programming
Concepts (The JavaTM
- How my Dog learned Polymorphism (JavaRanch).
- Working with objects
(Trygve Reenskaug, P. Wold and O.A. Lehne, 1995)
- Object Orientation Redefined (Soegaard, Mads, 2005).
- Objects First with Java - A Practical Introduction using BlueJ (Barnes & KÃ¶lling, 2006).
- Object Orientation Revealed!
(Dr Ashley M. Aitken, 1999)
more books into Google Print