Hi Sonu,
tyr with the below and run the application.
1) take the driver program(food.java) out of the foodpackagefruitpackage
package.
2) remove package foodpackagefruitpackage; from food.java
3) Import the food class (import foodpackagefruitpackage.food;) in food.java
file
Regards,
On Jul 11, 5:25 pm, Sonu Mittal wrote:
> I have 2 files namely food.java and foodmain.java both files' code is
> given below.
>
> FOODMAIN.java
>
> package foodpackagefruitpackage;
> public class foodmain {
> public foodmain(){}
> public static void main(String []args){
> int price;
>
Hi,The problem is you have the main method in your two classes.
Get rid of this code "public static void main(String[] args) { }" in your
second class and you should be OK.
2009/7/11 Sonu Mittal
>
> I have 2 files namely food.java and foodmain.java both files' code is
> given below.
>
> FOODM