Question: Consider the following test code placed in the test class within the main() method. Your task is to Java class Box so that the expected

Consider the following test code placed in the test class within the main() method. Your task is to Java class Box so that the expected output is produced.

Test Result

int width = 50;

int height = 18;

int depth = 8;

String builder = "Arthur ";

Box a = new Box(width, height, depth);

System.out.println(a.printMe());

Box b = new Box(width, height, depth, builder);

System.out.println(b.printMe());

Box built.

Width: 50

Height: 18

Depth: 8

Built by

null

Box built.

Width: 50

Height: 18

Depth: 8

Built by

Arthur

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In order to achieve the expected output you will need to modify the Box class to include a construct... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!