Question: ***MUST BE IN JAVA*** Write a Clothing class with the following attributes: color (e.g., blue, green, orange) displayName (e.g., Doctor Who hoodie, slacks) price (e.g.,
***MUST BE IN JAVA***
Write a Clothing class with the following attributes: color (e.g., "blue", "green", "orange") displayName (e.g., "Doctor Who hoodie", "slacks") price (e.g., 19.99, 7) Include only one constructor. It should have parameters for each of the attributes and set their values. Additionally, include getters and setters for each of the attributes. Add a driver, name it Purchases, and create 2 Clothing objects. Finally, print out some information about both objects (i.e., print the information from some or all of the getters). For example, if you created a Clothing object whose color was blue, whose display name was work trousers, for a price of 27.99, you could use the getters to print something like this: These work trousers are blue and cost $27.99. Don't hardcode the print statement for full credit, you must use the getters.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
