//new to java /
Learning and Teaching Object
Orientation with BlueJ
A systematic and experimental approach to learning Java
JAVA IN ACTION
PHOTOGRAPH BY JOHN BLYTHE
In the previous issues of Java Magazine, we went step by
step through a project of building a simple game in Java using
the Greenfoot environment.
Greenfoot is a great tool to
engage young learners by getting them highly motivated very
quickly. The ease with which
we can put animated graphics
onscreen is a fantastic help in
drawing kids to programming.
This time, however, we want to
look at approaching the learning
and teaching of object-oriented
programming more systematically. To support this, we will use
another tool: BlueJ.
The strength of Greenfoot is a
quick, playful entry to programming with immediate visual
results. The drawback, however,
is that there is a bit of magic
going on: some of the code is
provided by the environment
(the runtime framework), and the
type of program we can create is
restricted to two-dimensional
We now grow up a bit and shift
to BlueJ. BlueJ is a generic development environment—no code
is magically provided, and we can
develop any kind of application we
like. Thus, in its purpose, it is closer
to well-known professional IDEs,
such as NetBeans and Eclipse.
However, it is still an IDE focused
on learning object orientation, and
for a variety of reasons, it is much
better suited to beginners than
large professional environments.
In this article, I will provide an
overview of BlueJ, which is most
useful for those of you who can
already program and are looking
for a tool to teach programming
to beginners, either at the university level, toward the end of
high school (for example, in an AP
computer science course), or in an
after-school programming club. I
will give you an idea what BlueJ is
and what it provides.
The best way to read this article
is to download BlueJ and install
it. Then download the “people”
project, and play along as we go.
In future issues of Java
Magazine, I will go through a
small project that can be used to
learn object-oriented programming with BlueJ and Java.
The first question many people ask
when I talk about teaching object
orientation and Java to beginners
is, “Why not just use NetBeans or
Eclipse or (insert your own favorite
environment here)?” The answer
is that the requirements for an
environment for beginners are
significantly different than the
requirements for an environment
for professional programmers.