Java Programming

In this Lab1 you will practice defining generic classes, sorting algorithms, and the simple data structure array
1- Complete the program below, then execute it. The missing code is indicated by "???"
2- Create now a new class of your choice, e.g., Book, Student, Stock, Animal, …, with at least three fields.
3- Develop a method that initializes an array of the newly created class objects, and another method that
prints all the objects stored in the array following a certain criteria of you choice (e.g, Students living
in Abi Dhabi, Books having price higher then 200AED, …) .
4- Add another line to the main to sort all your objects based on a field of your choice, e.g., studentID,
stockPrice, …
5- Develop a new method to sort the array now using the Bubble sort algorithm discussed in class (partial

Sample Solution