关于Package compilation问题
What happens when you attempt to compile and run these two files in the same directory?
//File P1.java
package MyPackage;
class P1
{
void myMethod()
{
System.out.println("What a fancy method");
}
}
//File P2.java
public class P2 extends P1
{
myMethod();
}
问题1:调试p1.java时,需要建立一个名为MyPackage的文件夹吗?
2、我不知道该怎样放置这两个文件,其对应的相对存放位置如何,因为我无法编译p2,提示找不到p1
请高手赐教!