Skip to content

Instantly share code, notes, and snippets.

@consoledotblog
Forked from NPantola/TestObject.scala
Created August 25, 2014 14:44
Show Gist options
  • Save consoledotblog/cf7f18e45277c6864bff to your computer and use it in GitHub Desktop.
Save consoledotblog/cf7f18e45277c6864bff 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