Scala — class declared fields and access modifiers

前端 未结 2 1268
无人共我
无人共我 2020-12-19 06:57

I have been experimenting with Manifests and such in Scala, and I am having a very hard finding a way to use an object\'s fields when accessed via the getDeclaredFields meth

2条回答
  •  离开以前
    2020-12-19 07:40

    All JVM fields in Scala are private. Access to them is made only through getters, in Scala, so that there's no distinction between them and a parameterless method.

提交回复
热议问题