How do I create a Java package for different files? I have tried the following. What have I done wrong? And what is the right procedure?
The first file is:
package dil;
public class Hello
{
Support sp=new Support();
int i=sp.tin();
public void man()
{
System.out.println(i);
}
}
The second file is:
package dil;
class Support
{
public int tin()
{
return 3;
}
}
Now while I compile hello.java it shows these errors:
Hello:4:cannot find symbol
symbol: class Support
location: class dil.hello
Support sp=new Support();
^
Hello:4:cannot find symbol
symbol: class Support
location: class dil.hello
Support sp=new Support();
^
Where is the problem and how can I put both these files in a package?
The files are in c:\src.