Anonymous user
Singly-linked list/Element removal: Difference between revisions
→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
(→{{header|Fortran}}: Mnemonics and intent.) |
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
||
Line 120:
=={{header|Kotlin}}==
<lang scala>// version 1.1.
class Node<T: Number>(var data: T, var next: Node<T>? = null) {
override fun toString(): String {
val sb = StringBuilder(this.data.toString())
Line 154:
}
}
}
fun main(args: Array<String>) {
val b = Node(3)
val a = Node(1, b)
|