Write a class called shelf that contains instance data that


Question: Write a class called Shelf that contains instance data that represents the length, breadth, and capacity of the shelf. Also include a boolean variable called occupied as instance data that represents whether the shelf is occupied or not. Define the Shelf constructor to accept and initialize the height, width, and capacity of the shelf. Each newly created Shelf is vacant (the constructor should initialize occupied to false). Include getter and setter methods for all instance data. Include a toString method that returns a one-line description of the shelf. Create a driver class called ShelfCheck, whose main method instantiates and updates several Shelf objects.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a class called shelf that contains instance data that
Reference No:- TGS02318566

Expected delivery within 24 Hours