Table of Contents

Lesson 6

Java collections

Objectives

Understanding collection types:

Documentation

Clasa Object
Colectii de obiecte
Java interview questions and answers

Exercises

Exercises 1

Change 'BirdControler' application from section polimorfism so that it stores all birds in an ArrayList collection.

Exercise 2

Starting from the previous exercise, add a name attribute which can store a name for each bird. Display a sorted lists of birds by their names. Use Comparable interface to implement this exercise.

Exercise 3

Update 'Dictionar' application from section Colectii so that it can remove a word from the dictionary.

Exercise 4

Create a simulator for a road traffic crossroad. Each road is composed of one input lane and one output lane. Model input lanes using LinkedList collection class. Chars which are exiting the crossroad are removed from system. There should be a counter for each output lane containing the number of cars which exited that lane.

Create the class diagram and implement java application for the simulator.

Exercise 5

Create a students catalog for a course which provide following functions: