subject

Public class DebugBox {
private int width;
private int length;
private int height;
public DebugBox()
{
length = 1;
width = 1;
height = 1;
}
public DebugBox(int width, int length, height)
{
width = width;
length = length;
height = height;
}
public void showData()
{
System. out. println("Width: + width + " Length: " +
length + " Height: "+ height);
}
public double getVolume()
{
double vol = length + wdth + height;
return vol;
}
}

// This class uses a DebugBox class to instantiate two Box objects
public class DebugFour3
{
public static void main(String args[])
{
int width = 12,
length = 10,
height = 8;
DebugBox box1 = new DebugBox();
debugBox box2 = new DebugBox(width, length, height);
System. out. println("The dimensions of the first box are");
box1.showData;
System. out. print(" The volume of the first box is ");
showVolume(box1);
System. out. println(The dimensions of the second box are");
box2.showData();
System. out. print(" The volume of the second box is ");
showVolume(box2);
}
public static void showVolume(DebugBox aBox)
{
double vol = aBox. getVolume();
System. out. println(volume);
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
How can data be added in a table by using what view
Answers: 1
question
Computers and Technology, 22.06.2019 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 22.06.2019 18:10
How can i delete permalinks from a word press site?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
You know the right answer?
Public class DebugBox {
private int width;
private int length;
private int height...
Questions
question
Biology, 08.12.2020 17:10
question
Mathematics, 08.12.2020 17:10
question
Mathematics, 08.12.2020 17:10
question
English, 08.12.2020 17:10
Questions on the website: 13722361