Compile and run this java program

后端 未结 5 580
离开以前
离开以前 2021-01-23 12:06

How do I compile and run the following programs:

Test1.java:

package A;

public class Test1
{
    public int a = 1;
}

Test2.java:

5条回答
  •  旧巷少年郎
    2021-01-23 12:44

    you should keep your .java files in directory structure matching your package structure

    so Test1.java should go in directory A so Test2.java should go in directory B

提交回复
热议问题