日期:2014-05-20  浏览次数:20758 次

以前关心过我的帖子的继续来帮忙嘛.我自己写了个程序,但是最后着抛出了个异常,求助

  100分求助一帮助:我写了一个简单的程序,最后主函数哪儿错了,实在不知道怎么修改。希望高手斧正。。。
class   point{
  protected   int   x,y;
  public   point(){
      x=0;
      y=0;
}
public   point(int   x,int   y){
        this.x=x;
        this.y=y;
}
public   int   getX(){
    return   x;
}

public   int   getY(){
    return   y;
}

public   void   setX(int   x){
    this.x=x;
}

public   void   setY(int   y){
    this.y=y;
}
}

class   Circle   extends   point{
        protected   int   radius;
        public   Circle(int   r,int   x,int   y){
        super(x,y);
        radius=r;
        }
          public   Circle(){
          radius=0;
          }
        public   Circle(int   r){
                radius=r;
        }
          public   int   getRadius(){
          return   radius;
          }
void   area(){
  System.out.println( "圆的面积: "+   Math.PI*radius*radius);
        }
double   A()
{
return   Math.PI*radius*radius;
}
}

class   Cylinder   extends   Circle{
        protected   int   height;
    Cylinder(int   x,int   y,int   radius,int   height){
            super(x,y,radius);
            this.height=   height;
}  
    Cylinder()
{
      height=0;
}
    Cylinder(int   H){
          height=H;
}  
      int   getHeight(){
        return   height;
  }
void   volume(){
  System.out.println( "圆zhu的体积: "+A()*height);
}
}
  class   demo{
  public   static   void   main(String   args[]){
                  Cylinder   r1=new   Cylinder(10,10,10,10);
                  System.out.println( "中心坐标: "+(r1.x+ "   "+r1.y));
                  System.out.println( "半径: "+r1.radius);
                  System.out.println( "高: "+r1.height);
                  r1.volume();
    }
}

    我编译都没问题   ,就是运行时出现错误。下面是我的编译,运行:
F:\> javac   point.java

F:\> java   point
Exception   in   thread   "main "   java.lang.NoSuchMethodError:   main

F:\>
我希望得到的结果是:
  中心坐标:10   10
  半径:10
  高:10