Hello,

Can someone help me to figure out what the problem is?

I have two classes: Food and FoodMain as below.

the error I got is:
-----------------------------------------------------------------------
package myFood does not exist
<identifier> expected
illegal start of type

-----------------------------------------------------------------------
Food.java

package foodpackage.fruitpackage;

public class Food
{

    // Declare instance variables.
    private String name;

    public Food(){
    }

    public Food (String foodName)
    {
        name = foodName;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String temp )
    {
        name =temp;
    }

}



FoodMain.java

package foodpackage.fruitpackage;

public class FoodMain
{
    Food myFood  = new Food();

    myFood.setName("dsfa");

    //System.out.println("");
}



Thanks

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to