当前位置:网站首页>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"
}边栏推荐
- JS copy picture to clipboard read clipboard
- Basic use of CTF web shrink template injection nmap
- Introduction à l'objet blob
- [quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
- Unityhub cracking & unity cracking
- 【无标题】
- Complete linear regression manually based on pytoch framework
- CTF-WEB shrine模板注入nmap的基本使用
- Openjudge noi 2.1 1752: chicken and rabbit in the same cage
- Niu Mei's mathematical problem --- combinatorial number
猜你喜欢

Unityhub cracking & unity cracking

Register of assembly language by Wang Shuang

轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷

Vulnerability recurrence fastjson deserialization

【数字IC验证快速入门】11、Verilog TestBench(VTB)入门

在Rainbond中实现数据库结构自动化升级

【数字IC验证快速入门】14、SystemVerilog学习之基本语法1(数组、队列、结构体、枚举、字符串...内含实践练习)

在Rainbond中一键部署高可用 EMQX 集群

Lua 编程学习笔记

船载雷达天线滑环的使用
随机推荐
漏洞复现-Fastjson 反序列化
Recursive method constructs binary tree from middle order and post order traversal sequence
ROS bridge notes (05) - Carla_ ackermann_ Control function package (convert Ackermann messages into carlaegovehiclecontrol messages)
Summary of redis functions
Leetcode simple question: find the K beauty value of a number
【踩坑系列】uniapp之h5 跨域的问题
Introduction à l'objet blob
Myabtis_Plus
Avatary's livedriver trial experience
The element with setfieldsvalue set is obtained as undefined with GetFieldValue
【数字IC验证快速入门】11、Verilog TestBench(VTB)入门
通俗易懂单点登录SSO
JS copy picture to clipboard read clipboard
JS cross browser parsing XML application
【雅思口语】安娜口语学习记录 Part3
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
在 Rainbond 中一键安装高可用 Nacos 集群
追风赶月莫停留,平芜尽处是春山
基于Pytorch 框架手动完成线性回归