Question: Java and please do the first picture and run with the codes below and test codes thank you! public class Shape List private static final

Java and please do the first picture and run with the codes below and test codes thank you!

Java and please do the first picture and run with the codesbelow and test codes thank you! public class Shape List private staticfinal int DEFAULT_SIZE = 2; private Shape [] elements; private int count;public ShapeList() { // TODO: initialize the fields elements = new Shape[DEFAULT_SIZE] ; count = 0; // elements should be initialized as an

public class Shape List private static final int DEFAULT_SIZE = 2; private Shape [] elements; private int count; public ShapeList() { // TODO: initialize the fields elements = new Shape [DEFAULT_SIZE] ; count = 0; // elements should be initialized as an empty // array that holds DEFAULT_SIZE shapes } * Purpose: returns the number of elements in list Parameters: none * Returns: int - the number of elements public int size() { return count; Purpose: adds Shape s to back of this list Parameters: Shape * Returns: nothing - S public void add (Shape s) { // TODO } * Purpose: returns a String reprensentation of the elements in this list separated by newlines * Parameters: none * Returns: String - the representation * public String toString() { String s = "List contents:"; for (int i = 0; i

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 Databases Questions!