September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,3 +1,6 @@
|
|||
val a : Array<T> = // initialise a
|
||||
val b : Array<T> = // initialise b
|
||||
val c = (a.toList() + b.toList()).copyToArray()
|
||||
fun main(args: Array<String>) {
|
||||
val a: Array<Int> = arrayOf(1, 2, 3) // initialise a
|
||||
val b: Array<Int> = arrayOf(4, 5, 6) // initialise b
|
||||
val c: Array<Int> = (a.toList() + b.toList()).toTypedArray()
|
||||
println(c)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
fun arrayConcat(a : Array<Any>, b : Array<Any>)
|
||||
= Array<Any>(a.size + b.size, {if (it in a.indices) a[it] else b[it - a.size]})
|
||||
fun arrayConcat(a: Array<Any>, b: Array<Any>): Array<Any> {
|
||||
return Array(a.size + b.size, { if (it in a.indices) a[it] else b[it - a.size] })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
val a : Collection<T> // initialise a
|
||||
val b : Collection<T> = // initialise b
|
||||
val c : Collection = a + b
|
||||
fun main(args: Array<String>) {
|
||||
val a: Collection<Int> = listOf(1, 2, 3) // initialise a
|
||||
val b: Collection<Int> = listOf(4, 5, 6) // initialise b
|
||||
val c: Collection<Int> = a + b
|
||||
println(c)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue