Question: / * * Initialize an empty sequence with a specified initial capacity. Note that the append method works efficiently ( without needing more memory )

/**
Initialize an empty sequence with a specified initial capacity. Note that
the append method works
efficiently (without needing more memory) until this capacity is reached.
@param initialCapacity
the initial capacity of this sequence
@precondition
initialCapacity is non-negative.
@postcondition
This sequence is empty and has the given initial capacity.
@exception IllegalArgumentException
Indicates that initialCapacity is negative.
@exception OutOfMemoryError
Indicates insufficient memory for an array with this many elements.
new Ball[initialCapacity].
**/
public BallSeq(int initialCapacity)
// TODO: Implement this code.
assert wellformed() : "Invariant false at end of constructor";
Can anyone help me to complete todo
/ * * Initialize an empty sequence with a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!