Book cover

"OOP with Java" Errata

This page contains a list of errors in the source code in the book:
E. Ageenko "Object Oriented Programming with Java", University of Joensuu, 2003.


Errata to 2nd edition (2003) of the book:


Page 55, Section 3.1.g, Subsection "Converting Strings to Numbers":

Example:

value = Float.valueOf(data);

must be

value = Float.parseFloat(data);


Page 82, Section 4.1.a, Subsection "Reuse of concept":

Example for public class Person

for(int k = 1; k < data.length; k++) {

must be

for(int k = 1; k < v.length; k++) {

Example for abstract public class InsertionSort

static public void sort(Person[] v) {
    for(int k = 1; k < size(); k++) {
       while((j >= 0) && (lessThan(j+1,j))) {
          swap(j,j+1);
          j--;
} } }

must be

public void sort() {
    for(int k = 1; k < size(); k++) {
       int j = k-1;
       while((j >= 0) && (lessThan(j+1,j))) {
          swap(j,j+1);
          j--;
} } }


Page 131, Section 4.2.h, Subsection "Running Applet as a standalone GUI application":

Example for public class MyApplet extdens Applet

after the line

Frame f = new Frame("My Title");

must be

f.setLayout(new GridLayout(1,1));