I’m getting `NAME` has private acceess
# getting-started
e
I’m getting
NAME
has private acceess
o
@dmitry.petrov
d
Yes, it has private access, because it's a backing field of a property. In your case, you should probably write
Copy code
const val NAME = "..."
e
Oke guys, but why it is fine when I convert consuming class to kotlin?
probably const is better approach
d
Well, it depends. For example, when you use J2K to convert some Java class/interface to Kotlin, it also updates corresponding usages in Java code when required.
👀 1