程序小,问题大。怎么都不行!~~
为什么会有错:
------------------------------程序--------------------------------
import java.awt.Graphics;
calss Box{
double width;
double height;
double depth;
}
class BoxDemo extends java.applet.Applet
{public void paint(Graphics g)
{Box myBox=new Box();
double volume;
myBox.width=10;
myBox.height=20;
myBox.depth=15;
volume=myBox.width*myBox.height*myBox.depth;
g.drawString("the volume"+volume,25,50);
}
} ---------------------------------------------------------------------------------- 错误提示:
C:\>javac box.java
box.java:2: 'class' or 'interface' expected
calss Box{ ^ ---------------------------------------------------------------------- 请问大吓们什么原因啊!~~真的救命。一点搞不懂后面的也不好搞懂!~~ 真诚希望能帮我一下!~~~