Question: Please solve ASAP using Java, Thank you in advance!!TASK 5 : Create a user - defined class called P 1 ayex. Each Player object will
Please solve ASAP using Java, Thank you in advance!!TASK :
Create a userdefined class called Payex. Each Player object will have the following
attributes instance variables: name, position played, and jersey number.
Use appropriate data types to define these instance variables and use recommended
naming conventions for the variable names. Provide a constructor, implement the
accessor and mutator methods for each of the instance variables, and include the
tostring and equals methods.
TASK :
Create a client class named Client with the main method. Inside the main
method do the following:
Create an instance of ArrayBag called mensTeam to store players'
information of NDSU's Men's football team using the overload constructor to
make the initial length of the list array equal to
Add eight players to mensTeam by hardcoding eight calls to the add method
one for each player
Display the contents of mensTeam.
Remove a random player from mensTeam.
Display the contents of mensTeam.
Get but do not remove a reference to the item in the bag.
Display the contents of the reference you "got" it step
Add another Player with another hardcoded add method call.
Display the contents of mensTeam.
Remove the Player that you "got" in step using a call to the
remove e method.
Display the contents of mensTeam.
To demonstrate that your generic class can support objects of different types:
a Create an instance of an ArroyBag called courses to store the course ids of
the courses that you are taking this semester CSci as trings.
b Populate courses with each of your courses.
c Display the contents of courses.
d Remove a random course id from courses.
e Display the contents of courses.
Create an instance of LinkedBag called womensTeam to store the players'
information of NDSU's Women's basketball team.
Repeat steps through above for the womensTeam that uses an instance of
the LinkedBag class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
