Institute of Computer Science
Courses.cs.ut.ee Institute of Computer Science University of Tartu
  1. Courses
  2. 2018/19 spring
  3. Object-Oriented Programming (Narva College) (LTAT.NR.003)
ET
Log in

Object-Oriented Programming (Narva College) 2018/19 spring

  • Home
  • Materials
  • Java Glossary
  • Source Example
  • Cheat sheet (S1-S6)
  • Grading
  • Links
Session 12 

Tasks (to be submitted by Wed 01.05 23:55) 1 point

Task 1.

Create a class called IDRegister. The class should contain List<String> which holds personal identification numbers and the method register which adds a personal identification number to the list if it is not there yet. In addition, the program has to implement index method that returns the index of a personal identification number in the list or -1 if the personal identification number is not registered. Use synchronization so that the registry list is protected against the race. Use the list as a monitor.

Create the client class to demonstrate the work of threads.

Session 12 
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment