当前位置:网站首页>Infix keyword infix expression and the use of generic extension function in kotlin
Infix keyword infix expression and the use of generic extension function in kotlin
2022-07-07 08:14:00 【yu-Knight】
// Conditions for a : The first parameter is T.go Function extension
// Condition 2 : Need to be in parentheses (r:R) Pass a parameter in the parameter
private infix fun <T, R> T.go(r: R) {
println(" Infix expression , The content of the first parameter is :$this")
println(" Infix expression , The content of the second parameter is :$r")
}
fun main(){
//map Infix expression in
mapOf("map1" to 1)
mapOf("map2" to 2)
mapOf("map3" to 3)
// Infix expression written by myself
123 go "String"
"yuknight" go "kotlin"
}
边栏推荐
- 快解析内网穿透为文档加密行业保驾护航
- 在Rainbond中一键部署高可用 EMQX 集群
- Zsh shell adds automatic completion and syntax highlighting
- 央视太暖心了,手把手教你写HR最喜欢的简历
- [quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)
- Interactive book delivery - signed version of Oracle DBA work notes
- Basic use of CTF web shrink template injection nmap
- Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
- The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number
- [untitled]
猜你喜欢
随机推荐
[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO
Dedecms collects content without writing rules
【雅思口语】安娜口语学习记录 Part2
Qinglong panel -- Huahua reading
BiSeNet的特点
Vulnerability recurrence fastjson deserialization
漏洞复现-Fastjson 反序列化
ZCMU--1492: Problem D(C语言)
让Livelink初始Pose与动捕演员一致
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
机器人教育在动手实践中的真理
调用 pytorch API完成线性回归
【数字IC验证快速入门】10、Verilog RTL设计必会的FIFO
[step on the pit series] H5 cross domain problem of uniapp
Niu Mei's mathematical problem --- combinatorial number
复杂网络建模(三)
青龙面板--整理能用脚本
数据库实时同步利器——CDC(变化数据捕获技术)
解读创客思维与数学课程的实际运用
Complex network modeling (III)