#generic-classes #scala
Like in Java 5, Scala has built-in support for classes parameterized with types, e.g. Stack[T]
If you want to change selection, open document below and click on "Move attachment"
Generic Classes - Scala Documentation
<span>Like in Java 5 (aka. JDK 1.5), Scala has built-in support for classes parameterized with types. Such generic classes are particularly useful for the development of collection classes.
Here is an example which demonstrates this:
class Stack[T] {
var elems: List[T] = Nil
def p Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details