Create a public class called Crate that represents informati…
Create a public class called Crate that represents information about a shipping crate. The specifications for the fields and methods are given below. Fields (instance variables): crateID — an integer rows — an integer columns — an integer layers — an integer Methods: A constructor that takes four arguments for the crateID, rows, columns, and layers. Four getter methods called getCrateID(), getRows(), getColumns(), and getLayers() that return the values of the instance variables. A method called capacity() that computes and returns, as an integer, how many items the crate holds, calculated as rows * columns * layers. NOTE: Your methods and fields can be public. An example main method using this class is shown below: The output of this main method is shown below: CrateID: 142 capacity is 60
Read Details