Files
kotlin-fork/examples/src/Stack.jetl
T
2010-12-30 17:01:13 +03:00

13 lines
309 B
Plaintext

class Stack<T> : IPushPop<T> {
private val data = new ArrayList<T>();
override fun push(item : T) {
data.add(item) // Problem: I would like to write push(...) = data.add(...), but the types do not match
}
override fun pop() = data.removeLast()
override val isEmpty
get() = data.isEmpty
}