Create a java test class that simulates using your


Question: Create a class named MusicalInstrument and its four subclasses named Woodwind, Brass, String and Percussion.

The MusicalInstrument has a name, isPlaying, and isTuned data fields. It also has methods for setting and getting the values of each of the fields along with a method to display how the instrument is played.

A constructor that sets the isTuned and isPlaying fields to false is also included in the MusicalInstrument class.

You are welcome to add additional data fields and methods if you like.

Finally, create a Java test class that simulates using your MusicalInstrument class.  In your test class you should at a minimum:

1) Construct 4 instances of your instrument,

2) tune your instruments,

3) print the name of your instrument

4) print how you play your instrument 

In order to exercise polymorphism, please declare in the test class an array with 4 elements of type MusicalInstrument, and populate it with objects of each of the subclasses.

Include comments in code section. Code this in java programming.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Create a java test class that simulates using your
Reference No:- TGS0945563

Expected delivery within 24 Hours