当前位置:网站首页>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"
}
边栏推荐
- [quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
- 追风赶月莫停留,平芜尽处是春山
- 一文了解如何源码编译Rainbond基础组件
- 【数字IC验证快速入门】12、SystemVerilog TestBench(SVTB)入门
- Make LIVELINK's initial pose consistent with that of the mobile capture actor
- 船载雷达天线滑环的使用
- Four items that should be included in the management system of integral mall
- Real time monitoring of dog walking and rope pulling AI recognition helps smart city
- Lattice coloring - matrix fast power optimized shape pressure DP
- Pytorch(六) —— 模型调优tricks
猜你喜欢
game攻防世界逆向
Fast parsing intranet penetration escorts the document encryption industry
解析机器人科技发展观对社会研究论
Easy to understand SSO
解析创新教育体系中的创客教育
解读创客思维与数学课程的实际运用
[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)
Uniapp mobile terminal forced update function
提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
JS复制图片到剪切板 读取剪切板
随机推荐
Content of string
Lattice coloring - matrix fast power optimized shape pressure DP
Basic use of CTF web shrink template injection nmap
复杂网络建模(三)
调用 pytorch API完成线性回归
Qinglong panel -- finishing usable scripts
船载雷达天线滑环的使用
ZCMU--1396: 队列问题(2)
【无标题】
Unityhub cracking & unity cracking
ZCMU--1492: Problem D(C语言)
Vulnerability recurrence easy_ tornado
OpenVSCode云端IDE加入Rainbond一体化开发体系
Recursive construction of maximum binary tree
一文了解如何源码编译Rainbond基础组件
Blob 對象介紹
【Go ~ 0到1 】 第七天 获取时间戳,时间比较,时间格式转换,Sleep与定时器
【數字IC驗證快速入門】15、SystemVerilog學習之基本語法2(操作符、類型轉換、循環、Task/Function...內含實踐練習)
Introduction à l'objet blob
提高企业产品交付效率系列(1)—— 企业应用一键安装和升级