Question: In Java, design a class named Table to represent a table. The class contains: Three constants named WOOD, PLASTIC, and METAL with the values 1,

 In Java, design a class named Table to represent a table.

In Java, design a class named Table to represent a table. The class contains: Three constants named WOOD, PLASTIC, and METAL with the values 1, 2, and 3 to denote the type. (please do without using enum) A private int data field named type that specifies the type of the table (the default is PLASTIC). A private double data field named radius that specifies the radius of the table (the default is 10.0). A string data field named color that specifies the color of the table (the default is brown). The accessors and mutator methods for all three data fields. Ano-arg constructor that creates a default table. A constructor that populates all three data fields (values passed from the Table Tester class). A method called upgrade that would suggest a plastic table if the current table is wood, a metal table if the current table is plastic, and do nothing if the current table is already a metal table. Create a tester class named Table Tester that implements the Table class and allows testing of its functionality through an object of the Table class

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!