![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
java小程序运行出来说明为什么?
publicinterfaceValuable{publicdoublegetMoney();}interfaceProtectable{publicvoidbeProt...
public interface Valuable {
public double getMoney();
}
interface Protectable {
public void beProtected();
}
interface A extends Protectable {
void m();
}
abstract class Animal {
private String name;
abstract void enjoy();
}
class GoldenMonkey extends Animal implements Valuable,Protectable {
public double getMoney() {return 100000;}
public void beProtected() {
System.out.println("live in the room");
}
public void enjoy(){}
public void test() {
GoldenMonkey v = new GoldenMonkey();
v.getMoney();
Protectable p = (Protectable)v;
p.beProtected();
}
}
class Hen implements A {
public void m(){}
public void beProtected(){}
} 展开
public double getMoney();
}
interface Protectable {
public void beProtected();
}
interface A extends Protectable {
void m();
}
abstract class Animal {
private String name;
abstract void enjoy();
}
class GoldenMonkey extends Animal implements Valuable,Protectable {
public double getMoney() {return 100000;}
public void beProtected() {
System.out.println("live in the room");
}
public void enjoy(){}
public void test() {
GoldenMonkey v = new GoldenMonkey();
v.getMoney();
Protectable p = (Protectable)v;
p.beProtected();
}
}
class Hen implements A {
public void m(){}
public void beProtected(){}
} 展开
4个回答
展开全部
是没有
public state void main(String []args){
}
还是你代码没有复制全
public state void main(String []args){
}
还是你代码没有复制全
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你没有函数入口main
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
楼主把主方法拿来,这样没有规则。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询