Home > Back-end >  Java sprout new, request bosses guidance
Java sprout new, request bosses guidance

Time:10-26

According to the requirements of the following program:
(1) create a Box class, in the class: (1) to define three member variables, said a cube of long, wide, high; (2) define members method setBox (... ) for parameters (length, width, high) for inspection, if they are greater than zero, will they are assigned to the cube of the long, wide, high. Otherwise, the error is given, (3) define members method volumn (), the volume of a cube,
(2) to define the main class (Test), then respectively to do the following work: (1) create a Box class object cube; (2) call the above a proper method to realize to the cube of the long, wide, high value assignment as (three, four, five); (3) call the appropriate method, and the volume of a cube cube, and print output,
(3) in the main class, continue to define and create an array of a length of 4 Box class, called cubes. The for loop is used to calculate the sum of the four the volume of a cube in the array, (note: through method calls for cubes each cube is used in the long, wide, high) any assignment,

CodePudding user response:

You write not to come out of the difficulty

CodePudding user response:

The third write not to come out ah
  • Related