没有访问说明符定义的类的访问范围是什么?例如:
package com.foo.bar;
class MyFoo{
// All Class definition
}
我知道这样的类被称为package class
反对public class
。所以我的问题是我们可以从哪里访问和使用此类(因为它们似乎无法从任何地方访问)。我可以从同一个包的另一个公共类访问它吗?例如:
package com.foo.bar;
public class MyBar{
MyFoo foo; // Compiler throwing and error at this line
// Rest of definition
}
我已经问过谷歌,但无法从那里得到回复。