Compile and run this java program
<p>How do I compile and run the following programs:</p>

<p>Test1.java:</p>

<pre><code>package A;

public class Test1
{
    public int a = 1;
}
</code></pre>

<p>Test2.java:</p>

<pre><code>package B;

import A.*;

public class Test2
{
    public static void main(String [] args)
    {
        Test1 obj = new Test1();
        System.out.println(obj.a);
    }
}
</code></pre>

<p>I'm new to packages. 
If I compile using <code>javac *.java</code>
and manually create dir A, copy Test1.class into it and manually create dir B and copy Test2.class into it and then run <code>java B.Test2</code> it works. I'm sure this is not the right way of doing it. Please suggest.</p>
