This could be starting with you class path. It needs to have ./ in it to indicate the current directory. Then your source code needs to be placed in the same directory /java.
Remember each directory is actually a different package so anything you wish to share out side the package Constrictors, Methods etc must have public or protected access modifier
After you compile each, copy the class file to the currect subdirectory. Example:
package reddy;
public class Parent1{
public Parent1()
{
System.out.println("Parent Hello");
}
}
package reddy.test;
import reddy.Parent1;
public class child extends Parent1{
public child()
{
System.out.println("child Hello");
}
}
import reddy.*;
import reddy.test.child;
public class run{
public static void main(
String args[])
{
child c = new child();
}
}
typeing
java run gives the following output
Parent Hello
child Hello