Created
November 9, 2012 10:47
-
-
Save masahitojp/4045107 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
| class Sample(a0:Int, a1:Int) { | |
| println("cons") | |
| val n0 = a0 | |
| var n1 = a1 | |
| def this(a:Int) = { | |
| this(a, 2) | |
| println("sub") | |
| } | |
| } |
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> var a = new Sample(1) | |
| cons | |
| sub | |
| scala> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment