Computer Science, asked by priyankkumarpk2, 5 months ago

write a java class box whose default constructor initialize the dimensions, length, width and height of the box to zero to given values . The parameterized constructor is passed three double value each for its dimensions.​

Answers

Answered by freedarajesh2003
0

Answer:

Explanation:

Java Constructor Tutorial - A constructor initializes an object immediately ... This is because the implicit return type of a class constructor is the class type itself. ... to * initialize the dimensions of a box */ class Box { double width; double height; ... initializes all the instance variables to their default values, that are zero

Answered by deadpool132
2

Answer:

Java allows objects to initialize themselves whenever they are created. This automatic initialization is performed by the use of a constructor.A constructor initializes an object immediately upon creation. It has the same name as the class in which it resides and is syntactically same to a method.

Explanation:

i can give u all detail about your question but brainly have rule of how much we can write so sorry.please Mark me Brailient

Similar questions