想請教一下Java編程有關抽象類別與介面的問題
以下編程碼是這樣的:
abstract class CShape
{
protected String color;
public void setColor(String str)
{
color=str;
}
public abstract void show();
}
class CRectangle extends CShape
{
protected int wodth, height;
public CRectangle(int w, int h)
{
width=w;
height=h;
}
public void show()
{
System.out.println("color="+color+", ");
System.out.println("area="+width*height);
}
class CCircle extends Cshape
{
protected double radius;
public CCircle(double r)
{
radius=r;
}
public void show()
{
System.out.println("color="+color+", ");
System.out.println("area="+3.14*radius*radius);
}
}
class app11_1
{
public static void main(String args[])
{
CRectangle rect=new CRectangle(5, 10);
rect.setColor("Yellow");
rect.show();
CCircle cir=new CCircle(2.0);
cir.setColor("Green");
cir.show();
}
}
但不知道為什麼會出現以下的問題:
app11_1.java:50:reached end of file while parsing
}
^
1 error
想請教一下這個問題如何去解決???