How to Teach Java

From WikiEducator
Jump to: navigation, search

Some Title
Convenor: Yiannis Foukarakis

Kim Tucker, Nikos Peltekis



The discussion was primarily aimed at teaching Java to first year university students or high school, though we did touch on teaching kids Java.

We started with a "brain dump" to surface any aspect of this large topic for discussion. Some of these were discussed briefly as we went along and we took these notes which mainly link to resources of use to teachers and learners of Java.

Brain Dump

  • First make it fun :-).

There are many things to teach:

  • Object Oriented Programming
  • Language syntax
  • Basic Java Libraries for students with some background in C/C++
  • Using an IDE
  • Testing
  • etc.




These tutorials also indicate the fundamental topics to be taught.


  • BlueJ
  • Eclipse
  • NetBeans
  • JBuilder
    • Early versions generated ugly code and reams of it (bad for students to see, and inflexible, difficult to customise)
  • Borland Together - UML <-> Java
  • IntelliJ IDEA (full version commercial, but community edition is good for the basics)
    • Nice for students to see debugging
  • Teaching should start without an IDE in order to introduce the students to java basics.


Sites with Tests


Define your objectives:

  • By the end of this module students will be able to ...
  • Engage the students in coding activities - it must be fun
  • Understand the language (paradigm - OO, syntax, constructors, libraries, ...)
  • How to program in context - real world collaborative application development.

What is fun?

  • It is not fun to write programs that are of no use to anyone
    • avoid arbitrary exercises
    • some problem solving exercises can be interesting and fun
    • challenging but not too challenging

When in the curriculum to introduce Java?

  • Java may be introduced when OO is introduced.
    • Universities teach concepts rather than language specifics.
    • Teach generic language constructs (declarations, loops, recursion, ...)
    • Data structures
    • Objects
      • Classes, objects, messaging


  • Learn by example (copy-modify)

Other related exercises:

  • CRC Cards - role playing
  • UML tutorials and exercises using tools such as
    • ArgoUML
    • Fujaba
    • ATL
    • In general. use real world objects like vehicles, parking lots, animals, musical instruments, etc. (inheritance, collections, ...) - and use the same example for many constructs

Self (or instructor) testing:

  • Use sites with tests to allow students try on their own.
  • RoboCode - most popular.


  • Patterns and idioms (but only after a certain level of familiarity with the language has been reached).

Further Resources


Freedom to teach in different ways for different students using the hints and resources above.