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

个位高手看下点给改啊
abstract   class   Door{
        abstract   void   open();
        abstract   void   close();
}
interface   Alarm{
        void   alarm();
}
class   Alarm   Door   extends   Door   implements   Alarm{
        void   open(){};
        void   close(){};
        void   alarm(){};
}

public   class   Thedoor

{
public   static   void   main(String[]   args)
{
Door   door   =   new   Door();
System.out.println( "Door.open() ");
System.out.println( "Door.close() ");
System.out.println( "Door.alarm() ");

}
}

------解决方案--------------------
改好如下:
abstract class Door{
abstract void open();
abstract void close();
}
interface Alarm{
void alarm();
}
class AlarmDoor extends Door implements Alarm{
void open(){};
void close(){};
public void alarm(){};
}

public class Thedoor

{
public static void main(String[] args)
{
AlarmDoor door = new AlarmDoor();
System.out.println( "door.open() ");
System.out.println( "door.close() ");
System.out.println( "door.alarm() ");

}
}