当前位置:网站首页>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"
}
边栏推荐
- 通俗易懂单点登录SSO
- Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu
- 发挥创客教育空间的广泛实用性
- Rainbond 5.6 版本发布,增加多种安装方式,优化拓扑图操作体验
- 解析机器人科技发展观对社会研究论
- Game attack and defense world reverse
- 【数字IC验证快速入门】11、Verilog TestBench(VTB)入门
- Recursive method to verify whether a tree is a binary search tree (BST)
- Network learning (I) -- basic model learning
- JS copy picture to clipboard read clipboard
猜你喜欢
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
Interactive book delivery - signed version of Oracle DBA work notes
JS quick start (I)
Network learning (III) -- highly concurrent socket programming (epoll)
机器人教育在动手实践中的真理
运放电路的反馈电阻上并联一个电容是什么作用
一文了解如何源码编译Rainbond基础组件
CTF-WEB shrine模板注入nmap的基本使用
Vulnerability recurrence easy_ tornado
复杂网络建模(一)
随机推荐
Content of string
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
UnityHub破解&Unity破解
Complex network modeling (II)
uniapp 移动端强制更新功能
Leetcode medium question my schedule I
Avatary的LiveDriver试用体验
B. Value sequence thinking
The largest 3 same digits in the string of leetcode simple question
柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
jeeSite 表单页面的Excel 导入功能
Use of JMeter
运放电路的反馈电阻上并联一个电容是什么作用
通俗易懂单点登录SSO
藏书馆App基于Rainbond实现云原生DevOps的实践
Qinglong panel -- finishing usable scripts
BiSeNet的特点
Recursive construction of maximum binary tree
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
game攻防世界逆向