Created
March 20, 2013 12:19
-
-
Save beranradek/5204237 to your computer and use it in GitHub Desktop.
This file contains 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
val birthDate = new java.util.Date() | |
//> birthDate : java.util.Date = Sat Mar 16 19:55:08 CET 2013 | |
val man = Man("Johnny", birthDate, true) | |
//> man : app.Man = Man(Johnny,Sat Mar 16 19:55:08 CET 2013, true) | |
val woman = Woman("Jessica", birthDate, true) | |
//> woman : obj.Woman = Woman(Jessica,Sat Mar 16 19:55:08 CET 2013,true) | |
println(woman) // vola toString() | |
//> Woman(Jessica,Sat Mar 16 19:55:08 CET 2013,true) | |
println(Woman("Jessica", birthDate, true) == Woman("Jessica", birthDate, true)) | |
// vola equals | |
//> true | |
// println(woman.name) // nelze zkompilovat, name je private | |
println(Woman("Ginger", birthDate, false) == Woman("Adelie", birthDate, false)) | |
//> false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment