kotlin.Triple.<init>

<init>

Triple(first: A, second: B, third: C)

Represents a triad of values

There is no meaning attached to values in this class, it can be used for any purpose. Triple exhibits value semantics, i.e. two triples are equal if all three components are equal. An example of decomposing it into values:

import kotlin.test.*

fun main(args: Array<String>) {
//sampleStart
val (a, b, c) = Triple(2, "x", listOf(null))
println(a) // 2
println(b) // x
println(c) // [null]
//sampleEnd
}

Parameters

A - type of the first value.

B - type of the second value.

C - type of the third value.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-triple/-init-.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部