While Executing below program I'm getting error message as "Error: Main method not found in class Parent_Package.Parent, please define the main method as: public static void main(String[] args)".................. Can any one know how to resolve this??
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>