Syntax, Case Classes & Pattern Matching Basics val name: String = "Alice" // immutable — reassignment is a compile error var counter: Int = 0 // mutable — favor val, reach for var only when needed def add(a: Int, b: Int)…
ReadTraits, Concurrency & Build Tools Traits & Objects trait Named { def name: String } trait Aged { def age: Int; def isAdult: Boolean = age >= 18 } // concrete default method class Person(val name: String, val age: Int) ex…
ReadSave this stack to your personal DevRecall — add your own notes, track what you're learning, and share what you know with the community.
Get started — free forever