-
-
Save consoledotblog/cf7f18e45277c6864bff to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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 | |
} | |
} |
This file contains hidden or 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
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