的含義我試圖圍繞Scala語言來思考問題,並認爲最好的學習方法是將其付諸實踐。當在Java項目(Spring)和我的Scala項目之間複製粘貼代碼時,IDE做了一個我不明白的轉換。在互聯網和文檔中搜索它讓我不幸工作。private [context]
代碼:
@Bean private[context] def passwordEncoder: PasswordEncoder = {
return new BCryptPasswordEncoder
}
當編譯上面的代碼編譯器會抱怨:
`error: context is not an enclosing class`
有人能解釋一下什麼是private[context]
部分手段?
謝謝你!這讓我更加清楚。你指出在AccessQualifier進一步閱讀的規範中找到它的好東西。 – Bart