Question: IN JAVA. Create a Class representing the information in one item of your database. The information for one item must include a minimum of 3

IN JAVA.

Create a Class representing the information in one item of your database. The information for one item must include a minimum of 3 fields. Within the Class for one item, include the following methods:

A constructor that accepts the information about one item and assigns it to the instance data of the method.

A method that prints the information about ONE item of your collection. Name this method toString. NOTE: It is important that you name this method toString because it's one of Java's built-in methods that allows you print out your Object.

Create another Class with an Array of Objects of the Class of one item with the following methods:

Instantiate an Array of the Objects from the Class of one item.

Create a constructor to initialize the number of items in the array to zero.

Create a method to add one item at a time to the array.

Create a method to display the contents of the entire array. Call this method toString.

Create a method to increase the size of the array if it is getting full.

Create a Driver Class with a Menu with the option to add an item, to print out a list of all items, and exit.

Before printing the menu, populate the array by hard-coding the addition of 5 items to the array so that it has items already in it at the time the menu is displayed.

Test the menu by printing out the array, adding more items to the array, and then printing the array again.

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!