There are no properties in Java, so it’s impossibl...
# announcements
g
There are no properties in Java, so it’s impossible there. You can have private getter and public setter methods, but not properties. It’s popular feature request https://youtrack.jetbrains.com/issue/KT-14663
a
I was thinking more of something like this:
Copy code
public class Foo {
    private String bar;

    private String getBar() {
        return bar;
    }

    public void setBar(String bar) {
        this.bar = bar;
    }
}
But I was wrong, because you can’t use the property access syntax in Kotlin for this Java type.
But the fun part is that “convert to Kotlin” breaks on this code
It produces
Copy code
class Foo {
    private var bar: String? = null
        set
}
and changes the usage to:
Copy code
var foo = Foo()
foo.bar = "dsfafdas"
from
foo.setBar("dsfafdas")
i
I like the idea