当前位置:网站首页>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"
}边栏推荐
- B. Value sequence thinking
- Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu
- 【数字IC验证快速入门】13、SystemVerilog interface 和 program 学习
- Fast parsing intranet penetration escorts the document encryption industry
- Rainbond结合NeuVector实践容器安全管理
- opencv学习笔记五——梯度计算/边缘检测
- ZCMU--1396: 队列问题(2)
- Zcmu--1492: problem d (C language)
- Leetcode 187 Repeated DNA sequence (2022.07.06)
- 【數字IC驗證快速入門】15、SystemVerilog學習之基本語法2(操作符、類型轉換、循環、Task/Function...內含實踐練習)
猜你喜欢

Battery and motor technology have received great attention, but electric control technology is rarely mentioned?

LeetCode简单题之判断一个数的数字计数是否等于数位的值

快解析内网穿透为文档加密行业保驾护航
![[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)](/img/39/cac2b5492d374da393569e2ab467a4.png)
[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)

【雅思口语】安娜口语学习记录 Part2

Myabtis_Plus

运放电路的反馈电阻上并联一个电容是什么作用

Fast parsing intranet penetration escorts the document encryption industry

使用 Nocalhost 开发 Rainbond 上的微服务应用

buureservewp(2)
随机推荐
通俗易懂单点登录SSO
Network learning (I) -- basic model learning
青龙面板-今日头条
B. Value sequence thinking
提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
【踩坑系列】uniapp之h5 跨域的问题
追风赶月莫停留,平芜尽处是春山
CTF-WEB shrine模板注入nmap的基本使用
Dedecms collects content without writing rules
使用 Nocalhost 开发 Rainbond 上的微服务应用
Lattice coloring - matrix fast power optimized shape pressure DP
[untitled]
【雅思口语】安娜口语学习记录 Part2
Rainbond结合NeuVector实践容器安全管理
Application of slip ring of shipborne radar antenna
基于Pytorch 框架手动完成线性回归
柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number
eBPF Cilium实战(2) - 底层网络可观测性
Recursive method constructs binary tree from middle order and post order traversal sequence