Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a collection class StringCollection for an ArrayList with a method boolean that contains ( string s ) . The contains method iterats over the

Create a collection class StringCollection for an ArrayList with a method boolean that contains(string s). The contains method iterats over the collection and return true if it contains the string s, or false if it not. In addition, you should support Add and Remove, but you can delegate to ArrayList for the implementation.

Did you use inheritance or composition to create your collection class? Why?

Refactor your collection class to use the other type of collection class change from composition to inheritance depending on how the first one is made

Create a builder class to create a Car object. Cars can have GPS, TurbchargedEngine, Color, TransmissionType (automatic or manual), and an optional moonroof. You only need to show the definition of the Car class and the CarBuilder class.

For example, if your car defined a field of type GPS, you dont need to show the GPS class.

Create a program that continuously reads input from the user. The program will read the user input and get a certain type of Animal based on that input. The program should support Dogs, Cats, Bears, Horses, and Cows.

The Animal can then talk. The talking involves printing out to the console, but can say anything.

The animals (Dogs, Cats, Bears, etc.) and their interface will be in one package Zoo and should not be visible outside of the package. Only the Animal interface they all inherit from should be visible from outside the Zoo package.

The main method will be in a separate package. Call this one main.

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

Why We Listen?

Answered: 1 week ago