Assignment|代做Java – MyArrayList

Assignment|代做Java – 这是一个基础的java练习题目,通过java进行arraylist方面的训练

CSCI 225 assignment 1 1


Due: Sunday, Sept. 23, 2018, 10PM.

The java ArrayList is a resizable-array implementation of the Java List interface. The ArrayList has a capacity which can grow automatically as elements are added. For details of the standard ArrayList behaviour, please see

In this assignment, you will implement your own MyArrayList class, which imitates a subset of the ArrayList functionality. Whenever the capacity of your array changes as a result of a method call, you must make a deep copy of the array contents to a new array. For details explaining the required behaviour of each function, please refer to the comments written above each method prototype in the supplied skeleton file.

Download and from C4.

Include your name in the comments at the top of your file. Complete the implementation of the methods in that contain the comment //to be completed.

Use to test your code. It is highly recommended to add your own test methods to, so that you can thoroughly test both general and special cases for each method (e.g. add/remove/retrieve from an empty list, from a full list, partially full list, from the front/back/middle of the array, from invalid indices, etc.)


Method stubs

If you are unable to complete the implementation of any method, you may write a stub method. A stub contains in its method body only a default return statement of the appropriate type, so that the file is able to compile without errors.

Here is an example of a stub for the method public int removeAt(int index), which must return an int in order to compile:

public int removeAt(int index) { return – 1; }


Please upload to C4 before the deadline:

  • Your file with all methods completed, without syntax errors.


电子邮件地址不会被公开。 必填项已用*标注