当前位置:网站首页>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"
}
边栏推荐
- 基于Pytorch 框架手动完成线性回归
- Fast parsing intranet penetration escorts the document encryption industry
- The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number
- Complex network modeling (I)
- Unityhub cracking & unity cracking
- 互动送书-《Oracle DBA工作笔记》签名版
- [quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
- Qinglong panel -- finishing usable scripts
- Myabtis_ Plus
- 漏洞複現-Fastjson 反序列化
猜你喜欢
Fast parsing intranet penetration escorts the document encryption industry
数据库实时同步利器——CDC(变化数据捕获技术)
The zblog plug-in supports the plug-in pushed by Baidu Sogou 360
Réplication de vulnérabilité - désrialisation fastjson
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
一文了解如何源码编译Rainbond基础组件
Dedecms collects content without writing rules
船载雷达天线滑环的使用
饥荒云服管理脚本
CDC (change data capture technology), a powerful tool for real-time database synchronization
随机推荐
藏书馆App基于Rainbond实现云原生DevOps的实践
Excel import function of jeesite form page
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
offer收割机:两个长字符串数字相加求和(经典面试算法题)
OpenJudge NOI 2.1 1752:鸡兔同笼
JS quick start (I)
Zcmu--1396: queue problem (2)
柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
Interactive book delivery - signed version of Oracle DBA work notes
Blob 對象介紹
Dedecms collects content without writing rules
Avatary的LiveDriver试用体验
Recursive method to verify whether a tree is a binary search tree (BST)
JS复制图片到剪切板 读取剪切板
青龙面板--花花阅读
央视太暖心了,手把手教你写HR最喜欢的简历
ROS Bridge 笔记(05)— carla_ackermann_control 功能包(将Ackermann messages 转化为 CarlaEgoVehicleControl 消息)
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
uniapp 移动端强制更新功能
Réplication de vulnérabilité - désrialisation fastjson