no, it does not meet the requirements.
Not only does it not do anything like that the requirements state, but no code that doesn't even compile should ever be good enough to meet requirements.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
The class should have as a field an ArrayList of T. Write a public method named add, which accepts a parameter of type T. When an argument is passed to the method, it is added to the ArrayList.
Where in your code did you implement that requirement?
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
You need to make sure that you actually want an arrayList your code is not reflecting the title of your post. So you would 1st:
import java.util.*;
in one fashion or another...
Then:
ArrayList<Payday> myList = new ArrayList<Payday>();
make some sort of reference to an actual "arrayList". In my case I have created an arrayList called "myList" with the object Payday declared, it could easily be String or something else. Hope this is helpful, im a little unclear about your post
myList.add(object);
or
myList.add(index, object);
check java api
-jamesonh20
jamesonh20
Junior Poster in Training
66 posts since Dec 2009
Reputation Points: 22
Solved Threads: 6