KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In Java I sometimes use class variables to assign a unique ID to each new instance. I do something like public class Foo { private static long nextId = 0; public final long id; public Foo() { id = nextId; nextId++; } [...] } How can I do this in Scala?
Tags (comma-separated)
Save Edits
Cancel