Programming Java

Tasks studies - laboratory


Project maintained by dawidolko Hosted on GitHub Pages — Theme by dawidolko

Lab09 - Application of Generic Types

Task 0.

Write a generic class Pojemnik (Container) that stores an element of any type. Create methods to:

Task 1.

Implement and test a generic Pair class. Refer to slide 10 from the lecture for guidance. Create different types of pairs and test them.

Task 2.

Implement tuple classes: TupleTwo, TupleThree, TupleFour, which store two, three, and four values, respectively.

Task 3.

Given a program implementing a dynamic array that stores int values using regular arrays, modify the code to make it generic, allowing it to store any reference types.


cmd_gcc


cmd_gcc

Task 4.

Test the programs from slides 37 and 38 of the lecture. Add other types of classes with fruits.