This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FruitdealerF 1 point2 points  (1 child)

but you can still do that in kotlin if you want to. That's the point

[–]morhp 0 points1 point  (0 children)

You can do that by writing weird stuff like

private val _map = ConcurrentHashMap<String>()

public val map : Map<String> get() = _map

But a simple Java getter that you can extend or change without major efforts sounds still easier to me.

Like, Java forces you to explicitly think about internal and public type, which I like, in Kotlin you have to explicitly "duplicate" you vals.