class Box { double w = 0; //width double h = 0; //height double d = 0; //depth double v = 0; //volume void value(double w0, double h0, double d0) { w = w0; h = h0; d = d0; } double volume() { return w * h * d; } } public class Main { public static void main(String[] args) { double w1 = 10, h1 = 20, d1 = 40; Box Box1 = new Box(); Box Box2 = new Box(); Box1.value(w1, h1, d1); Box2.value(15, 20, 15); System.out.println("Об'єм кобобки 1 " + Box1.volume()); System.out.println("Об'єм кобобки 2 " + Box2.volume()); } }