Mar 04 2013, 10:52 AM
Code:
/* A program that uses the Box class.
Call this file BoxDemo.java
*/
class Box {
double width;
double height;
double depth;
}
// This class declares an object of type Box.
class BoxDemo {
public static void main(String args[]) {
Box mybox = new Box();
double vol;
// assign values to mybox's instance variables
mybox.width = 10;
mybox.height = 20;
mybox.depth = 15;
// compute volume of box
vol = mybox.width * mybox.height * mybox.depth;
System.out.println("Volume is " + vol);
}
}When executed it doesn't shows up anything (running in Netbeans)


![[-]](https://war-lords.net/forum/images/collapse.png)
![[Image: 629965_101.png]](http://wls.gameme.com/sig/629965_101.png)
![[Image: dav8ugf75d010z8vovm.gif]](http://clients.war-lords.net/imghost/images/dav8ugf75d010z8vovm.gif)