Compile and run this java program

后端 未结 5 702
离开以前
离开以前 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:48

    The compiler will create directories called A and B and place the .class files within them.

    You should not need to copy the class files manually into their package directories, and it will probably not work if you do that.

提交回复
热议问题