We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6e687d commit ad22833Copy full SHA for ad22833
core-kotlin-modules/core-kotlin-9/src/test/kotlin/com/baeldung/underscoreoperator/UnderScoreOperator.kt
@@ -0,0 +1,25 @@
1
+package com.baeldung.underscoreoperator
2
+// Before Kotlin 1.7
3
+class Box<T>(value: T) {
4
+ // Some class implementation
5
+}
6
+fun main() {
7
+ val intBox: Box<Int> = Box(42)
8
+ val anyBox: Box<Any> = Box("Some value")
9
10
+fun main1(args: Array<String>) {
11
+ val (_, second) = "ignored" to "hello"
12
+ println(second)
13
14
+fun mainTwo(args: Array<String>) {
15
+ val list = listOf("hi")
16
+ val list2 = list.mapIndexed { _, item -> item }
17
+ println(list2)
18
19
+inline fun <T> printElementInfo(element: T) {
20
+ println("Element: $element")
21
22
+fun mainForHOF() {
23
+ printElementInfo<_>(42)
24
+ printElementInfo<_>("Hello")
25
0 commit comments