Object-Oriented Programming: OOP Part 1

Location Aud. A, Fib 15.
Time September 10, 10.15-12.00
Subject This seminar covers the topics initialization and clean-up of objects. Many bugs in C programs are due to that variables have not been properly initialized. This problem is solved in object-oriented programming languages by adding a construct to the language called a constructor where the instance variables can be assigned reasonable start values. This way all the initialization happens in only one place. The opposite of initialization is clean-up. Java has an automatic main memory clean-up mechanism called a garbage collector. This means that clean-up in general is very simple in Java. However, note that the garbage collector only cleans up memory, it does not e.g., clean up connections to database or open files, these must be closed explicitly by the programmer.
Reading "Thinking in Java" Chapter 4. You may skip the sections  "How a Garbage Collector Works" pp. 188-191 and  "Multidimensional Arrays" pp. 208-211.
Exercises Exercise
Solutions Solutions for the exercises both documentation and source files
Examples The examples from the lecture, both documentation and source files
Slides PDF

Here links that are useful for the seminar are listed: