Object-Oriented Programming: OOP Part 1

Location NOVI
Time September 19, 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 "Absolute Java" Chapter 4. Skip "Methods that Return a Boolean Value" pp 190-192, "Recursive Methods" pp. 196, Section 4.2 "Information Hiding and Encapsulation" pp 198-209, "The StringTokenizer Class" pp. 233-239.
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: