Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago