Skip to content

Instantly share code, notes, and snippets.

@andrewharmellaw
Last active December 17, 2015 11:19
Show Gist options
  • Save andrewharmellaw/5601668 to your computer and use it in GitHub Desktop.
Save andrewharmellaw/5601668 to your computer and use it in GitHub Desktop.
Scala class with (mutable) var parameter
class ClassWithVarParameter(var description: String)
// Which is equivalent to the following in Java:
//
// public class ClassWithVarParameter() {
//
// private String description;
//
// public ClassWithVarParameter(String description) {
// this.description = description;
// }
//
// public String description() {
// return description;
// }
//
// public void description(String description) {
// this.description = description;
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment