MSc Java Workshop

Lecture Log - Semester 1

The following is a log of the material covered in the Semester 1 Lectures.

Week Number Lecture Content Examples Tutorial material
Week 1

Pocket calculator kind computations, simple strings, variables

In the first lecture we briefly discussed platform independence, that a program has to be understandable to computers and humans. Strings, printing, simple computations, and variables.

int and Bool, compiling and running some simple Java programs

ExamplesSVN guide Tutorial Handout
Week 2

Classes and objects

The idea and a first example for classes and objects, Date and BankAccount.
ExamplesTutorial Handout
Week 3

Types, conditionals, loops

We look at the 8 basic types in Java, at the conditionals if-else and switch, as well as at for-loops and while-loops.
ExamplesTutorial Handout
Week 4

Array, ArrayList, Syntactic Sugar, Scanner, Eclipse

1-dimensional and 2-dimensional arrays are introduced, ArrayList. We look at printf, some syntactic sugar, keywords such as final, static, public, private. Furthermore we introduce the Scanner class for input. We also make use for the first time of the IDE Eclipse.
ExamplesTutorial Handout
Week 5

Classes, methods, objects - revisited

On Wednesday we looked again at the BankAccount example, the classes, methods and objects involved and reimplemented it using Eclipse. Library system - From ideas to code
ExamplesTutorial Handout Graham's example code Jack's example code
Week 6

Exceptions, Patterns, I/O

On Wednesday we looked again at the Library system example from week 5. Exception handling, patterns.
ExamplesTutorial Handout
Week 7

Inheritance

On Wednesday we extended the BankAccount class by a subclass BankAccountWithOverdraft. On Friday we had an inclass exercises to do the same for a BankAccount for mortgages.
ExamplesTutorial Handout
Sample Code
Week 8

Inheritance (Cont'd), Graphics

In the Wednesday lecture we looked at superclasses/subclasses in an overview, introduced abstract classes and looked at an other example: ComputerAccount and GuestAccount. In the Friday lecture we learned how to generate some graphics using the Graphics class.

ExamplesTutorial Handout
Week 9

Graphics (Cont'd)

In the Wednesday lecture we had a detailed look at the example of the graphics class. Friday there was no lecture because of the lock-down lab session.

see week 8 
Week 10

Interfaces, Graphics (Cont'd)

There was no lecture on Wednesday. On Friday we look at interfaces and further graphics examples, in particular how to load pictures.

ExamplesTutorial Handout
Week 11

Graphics (Cont'd), Generics

In the Wednesday lecture we made the graphics more flexible and allowed for input via JOptionPane and moved figures around. On Friday we revised the main concepts of Java as an object-oriented language (interfaces, abstract classes, classes, methods, inheritance) with strict typing (types and classes). Since strict typing would require at time duplication of code generics with a universal class T have been added to Java.

Examples