Skip to content

Instantly share code, notes, and snippets.

@NPantola
Last active August 29, 2015 14:05
Show Gist options
  • Save NPantola/61b9c21d6033d9f510f7 to your computer and use it in GitHub Desktop.
Save NPantola/61b9c21d6033d9f510f7 to your computer and use it in GitHub Desktop.
object TestObject extends TestTraitClass {
val immutableVariable: String = "Hello Immutable"
var mutableVariable: String = "Hello Mutable"
def getImmutable(): String = immutableVariable
def getMutable(): String = {
mutableVariable
}
def setMutable(m: String) = {
mutableVariable = m
}
}
trait TestTraitClass {
def getImmutable(): String
def getMutable(): String
def setMutable(m:String)
def implementedMethod(): String = "This is a string"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment