Forum : problem using package
Brief description  about Online courses   join in Online courses
View Sangita  Biswal 's Profile

problem using package

package family;

public class Mother
{
public static void display()
{
System.out.println("My mother's name is Kanaka Lata Biswal");
}
}

import MyClass.family.*;

public class MyFamily{

public static void main(String args[])
{
Mother.display();
}
}

The above programme shows the following error:

MyFamily.java:7: cannot access MyClass.family.Mother
bad class file: .\MyClass\family\Mother.class
class file contains wrong class: family.Mother
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
Mother.display();
^
1 error
Asked by Sangita Biswal | Apr 9, 2010 |  Reply now
Replies (2)
View sangita biswal 's Profile
please tell me what and how to import.
May 12, 2010
View arun kumar das 's Profile
Hi Sangita,

You are importing import MyClass.family.*; which is wrong. Please check this and revert back.

Cheers...
JT
Apr 15, 2010