在执行下面的程序时,我收到错误消息“错误:在 Parent_Package.Parent 类中找不到主方法,请将主方法定义为:public static void main(String[] args)”........ .......... 任何人都知道如何解决这个问题吗?
First Package
==============
package Parent_Package;
public class Parent {
int money = 100;enter code here
protected void give_Money(){
money = money-10;
System.out.println(money);
}
}
======================
Second Package
===================================
package Child_Package;
import Parent_Package.Parent;
class Child extends Parent{
public void donate() {
give_Money();
}
}
class Friend {
public static void main(String[] args){
Child c = new Child();
c.donate();
}
}
==================================================</body></html>