blob: 426bc28c9a98c6f6d9a2edd48848c1574c23b3f3 [file] [log] [blame] [edit]
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
}