Skip to content

Instantly share code, notes, and snippets.

@PragmaticCoding
Last active November 26, 2021 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PragmaticCoding/aee9580aad1e0d3a7347eb742f82ddda to your computer and use it in GitHub Desktop.
Save PragmaticCoding/aee9580aad1e0d3a7347eb742f82ddda to your computer and use it in GitHub Desktop.
Simple Kotlin Class Showing Getter and Setter Use
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