Hi, i'm a student and i have a homework about java i will attach the question
to my message if u can help me in solving the problem.
a. Define a class called Box with the following members:
· Data members length, width and height
· A no – parameters constructor.
· A constructor that takes parameters to initialize the data members
· ‘set’ Methods that will set the value of a particular data member to a
specific value received as a parameter.
· ‘get’ Methods that will return the value of a particular data member
· A Volume( ) method to calculate and return the volume of a Box.
b. Define a class TestBox with a main( ) method.
In the main( ) method of TestBox, create an instances of Box using each of
the constructors (no- parameters constructor and parameters-constructor)
Use the Volume method to calculate the volume of each box.
Allow the user to input new values for the length width and height of one
of the boxes.
(Call the set Methods to assign the new values to the data members).
Call the Volume( ) method to calculate the new volume of the box.
Display the new volume of the box
that all if u can help me in my homework.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL