Last active
August 29, 2015 14:02
-
-
Save ClintCombs/186b9804b1b37ee2280b to your computer and use it in GitHub Desktop.
Initialization for Groovy dudes.
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
// Scala Person case class | |
case class Person(first: String = "", last: String = "", age: Int = 0) | |
val p = Person(first = "John", last = "McPeek", age = 19) | |
val p1 = Person(first = "John") | |
// Scala PersonTrait | |
trait PersonTrait { | |
def first: String | |
def last: String | |
def age: Int | |
} | |
val pt = new PersonTrait { val first = "John"; val last = "McPeek"; val age = 19 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment