标签: scala scope private protected
private[SomePackage]
和
protected[SomePackage]
在Scala,某个地方我看到 private [SomePackage] ,我看到 protected [SomePackage]
答案 0 :(得分:1)
private[SomePackage]表示它只在包内可见(Java中没有修饰符)
protected[SomePackage]表示可以在子类中查看,但仅限于它们位于SomePackage
SomePackage