Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Generic Class Exercise 2 In the lecture (unit1), we implement the concept of waiting list of generic type using an array. 1- Now, we want

Generic Class Exercise 2 In the lecture (unit1), we implement the concept of waiting list of generic type using an array.

1- Now, we want to implement the concept (as generic ) using ArrayList. Your generic WaitingList class should include the following method:

a- add: it receives generic type elements and add it to the end of the list.

b- get: it receives an index and returns the element at the specific index (if there is ), or null if there is no such index.

c- remove: it removes the first element, and returns that element.

d- print: it prints the elements in the waiting list. Create class GC_Test, that has main method. In the main,

a- Create WaitingList of Car, and add three cars.

b- Test method remove, reverse , and print the list after each method to test the methods.

c- Create WaitingList of Student, and add four students.

d- Test method remove, reverse , and print the list after each method to test the methods.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions