Question: This is the code I came up with: public int getPosition(T anObject) { @SuppressWarnings(unused) int result = 0; int lastIndex = getLength()-2; for(int index =

This is the code I came up with:
public int getPosition(T anObject) { @SuppressWarnings("unused") int result = 0; int lastIndex = getLength()-2; for(int index = 0; index Project 04 Points: 100 points Problem Description: Suppose that you want an operation for the ADT list that returns the position of a given object in the list. The header of the method could be as follows: public int getPosition(T anObject) where T is the generic type of the objects in the list. / Locates a given object in this list. @ @param an0bject A given object. @return The position of anObject in the list.*/ public int getPosition( T anObject) \{ \} Write an implementation of this method for the class AList. Submition files: Driver.java, ListInterface.java, AList.java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
