Created
May 17, 2013 20:14
-
-
Save andrewharmellaw/5601709 to your computer and use it in GitHub Desktop.
Scala class with (immutable) val parameter
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 ClassWithValParameter(val name: String) | |
// Which is equivalent to the following in Java: | |
// | |
// public class ClassWithValParameter() { | |
// | |
// private String description; | |
// | |
// public ClassWithVarParameter(String description) { | |
// this.description = description; | |
// } | |
// | |
// public String description() { | |
// return description; | |
// } | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment