Help with ArrayList ? ....
Please help me I need the code for this question. Here it is....
Define a class named ArrayList. This class represents a list of objects and supports random access to its objects via a numeric index position. Thus, it should contain an array of Object. For this exercise, include an instance variable for the array, an instance variable to track the number of objects currently accessible in the array (its logical size), three constructors, and a toString method. The default constructor should create an array of five objects, all initially null. The second constructor expects an integer parameter. This constructor uses this integer as the initial length of the array. The third constructor expects an array of objects as an argument. It copies these objects to a new array instance variable of the same length. the count (logical size) of the accessible objects should be initialized appropriately in each constructor. The toString method builds and returns a string containing the string representations of the objects currently accessible in the array. When the logical size is 0, this is the empty string.
If anyone knows how to do this please help?....
Re: Help with ArrayList ? ....
Begin by reading the question closely and making sure you understand it. Specifically this means that you should know what methods and constructors your class will have including the types of their arguments and, for methods, the type they return. Additionally you should know what each method or constructor is supposed to do - it's a good idea to indicate this with a javadoc comment (probably just a sentence) accompanying each method and constructor.
Once you know what you are doing you can begin to implement each of the methods and constructors. At this point you might find it useful to have a main() method (possibly in another class) which tests each method and constructor to ensure that it does what it is documented to do.
-----
I doubt whether anyone is going to write your code for you. But if you are unsure about what the question means, post the skeletal code indicated above and someone is sure to say if they think you have left something out, or misinterpreted the intent of the question.
If, having implemented a method or constructor, you find that it doesn't perform exactly as documented, again post your code so you have a specific question that can be addressed.