Discussion board
java package
By Sangita Biswal
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();
}
}


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

please help me in importing the package in the right way.
Reply
Post   Reset
suman dustakar replied to Sangita Biswal Friday, May 14, 2010
ya it is possible, u hav to first create the package called MyClass, & inside tis package u hav to create another package called Family, tis can be done by declaring as,,,, package MyClass; package Family;.. after tis, u can create MyFamily.java class.. gud luck...