Implementing tasks

Preparation
  1. Download and unzip exam.zip. You should see a directory »Exam« containing a pom.xml file.

  2. Open this project in your IDEA IDE by selecting the Exam/pom.xml file. Your home directory is /home/student.

Task

exercise No. 269

Q:

Open the Readme.md file in your project's root. It contains all necessary instructions for solving the implementation tasks.

Das Projekt enthält zwei Wissensfragen zur Book.equals(...) Implementierung:

  1. Was wurde bei der Implementierung von Book.equals(...) falsch gemacht?

  2. Mit welcher Standard Java Vorgehensweise wäre das Problem sofort aufgefallen?

Nutzen Sie das Freitextfeld im Klausursystem zur Beantwortung. Dieser Anteil ergibt 20 Punkte.

Tipp

Redefinition von Methoden in abgeleiteten Klassen.

A:

Solution to all implementing tasks:

  1. Standalone solve.zip compressed project solution.

  2. Gitlab link 2014winter/Solve.

  1. Zum einen stimmt die Signatur nicht: Statt equals(Book b) müsste die Methode als Object.equals(Object o) deklariert sein. Zudem muss sie auch public statt private sein.

  2. Eine @Override Annotation hätte sofort erkennen lassen, dass die beschriebene equals(Book b) Methode eine von Object.equals(Object o) abweichende Signatur hat und insbesondere private statt public deklariert ist.

Caveats
  • When approaching end of examination check your input for completeness prior to being automatically logged out by the system. Remember: There is 120 minutes for the examination and another 5 minutes to check for completeness.

  • Projects residing just on your local workstation's file system cannot be recovered after finishing the exam.