English 中文(简体)
什么是受保护的意思?
原标题:What does protected[session] mean in Scala?

W以及ering through ScalaQuery source code I ve found such declarations (many of the kind actually):

private[session] val dyn = new DynamicVariable[Session](null)

以及

def forDataSource(ds: DataSource): Database = new Database {
  protected[session] def createConnection(): Connection = ds.getConnection
}

什么意思是<条码>。 我认为,在一项职能中界定的职能不能成为<条码>受保护的<>条/代码>。

最佳回答

createConnection is not within forDataSource, 载于——见new Database{ on the previous line?

这意味着范围的所有事项:<条码>。 (可能是一个类别、物体或包裹——我不知道)可以看到这一定义,加上延伸<代码>Database的类别。

问题回答

http://www.un.org/Depts/DGACM/index_french.htm i.e. 只有属于(包装或班级)的班级才能进入成员。

protected [<cop>]系指,只有延伸这一类别(的班级才有资格进入<>>。

除此以外,还有<条码>私人[本],这意味着该成员只在某类特定情况下才可见。





相关问题
Help to understand the issue with protected method

I m reading Sybex Complete Java 2 Certification Study Guide April 2005 (ISBN0782144195). This book is for java developers who wants to pass java certification. After a chapter about access modifiers (...

AS3: overriding protected var in subclass

I m having a blackout here. I thought I understood these principles, but I can t seem to get it working anymore. I want to let a DeleteButton inherit from a general Button class. This DeleteButton ...

Problem with protected fields in base class in c++

I have a base class, say BassClass, with some fields, which I made them protected, and some pure virtual functions. Then the derived class, say DerivedClass, like class DerivedClass : public BassClass....

热门标签