Skip to content

Instantly share code, notes, and snippets.

@masahitojp
Created November 9, 2012 10:47
Show Gist options
  • Select an option

  • Save masahitojp/4045107 to your computer and use it in GitHub Desktop.

Select an option

Save masahitojp/4045107 to your computer and use it in GitHub Desktop.
class Sample(a0:Int, a1:Int) {
println("cons")
val n0 = a0
var n1 = a1
def this(a:Int) = {
this(a, 2)
println("sub")
}
}
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