How do I compile and run the following programs:
Test1.java:
package A; public class Test1 { public int a = 1; }
Test2.java:
This isn't a direct answer to your question but you might want to start thinking about using an IDE (others suggested ant). I would recommend jcreator if you are just starting out or Eclipse if you want something good.