Does kotlin have an equivalence of the C++ static ...
# announcements
v
Does kotlin have an equivalence of the C++ static member field? It can be done in Java, but I can't think how I'd do it in kotlin. https://www.geeksforgeeks.org/static-keyword-in-java/
d
Usually a companion object is used for static in Kotlin: https://kotlinlang.org/docs/reference/object-declarations.html#companion-objects Sometimes a top level property resp. function can also be appropriate though.
v
I just hadn't thought through how I'd make it work with a companion object. Sorted now, thanks.