This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KotlinClass() { | |
public var nickName: String = "" | |
set(value) { | |
field = value | |
println("in the setter") | |
} | |
get() { | |
println("in the getter") | |
return field | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KotlinClass() { | |
public var nickName: String = "" | |
} | |
fun main(args: Array<String>) { | |
val testClass = KotlinClass() | |
testClass.nickName = "Shorty" | |
println("Nickname: $testclass.nickName") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final StringProperty firstName = new SimpleStringProperty("Alloysius"); | |
public String getFirstName() { | |
return firstName.get(); | |
} | |
public StringProperty firstNameProperty() { | |
return firstName; | |
} |
NewerOlder