Lab 1
Lab 1
Create a generic class named Box that can store any type of object. The Box
class should have methods to put an object into the box (put) and retrieve the
object from the box (get). Additionally, implement a method printContents that
prints the contents of the box. Then, create a simple program to demonstrate the
usage of this generic class with different types of objects.
Implement a simple program to demonstrate the usage of this generic class with
different types of items.
- Create a Tuple for person's name (String), age (Integer), and occupation
(String)
- Create a Tuple for product ID (String), price (Double), and availability
(Boolean)