الرجوع
تسجيل الدخول

What is the output of this code?

class Box {
    private int length, width, height;

    public void setDimensions(int l, int w, int h) {
        length = l;
        width = w;
        height = h;
    }

    public int getVolume() {
        return length * width * height;
    }
}

public class TestBox {
    public static void main(String[] args) {
        Box box = new Box();
        box.setDimensions(3, 4, 5);
        System.out.println("Volume of the box is " + box.getVolume());
    }
}