Last active
November 26, 2021 20:14
-
-
Save PragmaticCoding/aee9580aad1e0d3a7347eb742f82ddda to your computer and use it in GitHub Desktop.
Simple Kotlin Class Showing Getter and Setter Use
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 Sample { | |
var intField: Int = 0 | |
} | |
fun UseSample() { | |
val sample = Sample() | |
sample.setIntField(3) | |
println(sample.getIntField()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment