当前位置:网站首页>Kotlin扩展函数实现原理
Kotlin扩展函数实现原理
2022-06-12 12:06:00 【Duckdan】
package study.yang.carditemdemo.capture
fun String.contact(str: String): String {
return this.plus(str)
}
fun main(){
println("====".contact("哈哈喜欢"))
}
package study.yang.carditemdemo.capture;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
@Metadata(
mv = {
1, 1, 15},
bv = {
1, 0, 3},
k = 2,
d1 = {
"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\u001a\u0006\u0010\u0000\u001a\u00020\u0001\u001a\u0012\u0010\u0002\u001a\u00020\u0003*\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0003¨\u0006\u0005"},
d2 = {
"main", "", "contact", "", "str", "app_debug"}
)
public final class StringKt {
//通过创建静态函数的方式实现的
@NotNull
public static final String contact(@NotNull String $this$contact, @NotNull String str) {
Intrinsics.checkParameterIsNotNull($this$contact, "$this$contact");
Intrinsics.checkParameterIsNotNull(str, "str");
return $this$contact + str;
}
public static final void main() {
String var0 = contact("====", "哈哈喜欢");
boolean var1 = false;
System.out.println(var0);
}
// $FF: synthetic method
public static void main(String[] var0) {
main();
}
}
边栏推荐
猜你喜欢

視頻分類的類間和類內關系——正則化

PDSCH 相关

ARM processor mode and register

PDSCH related

Ficusjs series (I) introduction to ficusjs

Left and right cases + rotating pictures of small dots + no time

必杀技--使用FFmpeg命令快速精准剪切视频

Open source project - (erp+ Hotel + e-commerce) background management system

B.刷墙(C语言)

6.6 rl:mdp and reward function
随机推荐
为什么新品发布上架之后会没有流量,新品应该怎么发布?
Load/store memory access instruction of arm instruction set (1)
Design of tablewithpage
Getting started with NVIDIA Jetson nano Developer Kit
【QNX Hypervisor 2.2 用户手册】4 构建QNX Hypervisor系统
必杀技--使用FFmpeg命令快速精准剪切视频
Rich text editor copying pictures in word documents
6.6 rl:mdp and reward function
The first thing with a server
ARM指令集之跳转指令
ARM指令集之Load/Store指令寻址方式(一)
什么是模块化?模块化的好处
Design of virtual scrolling list
Channel Shuffle类
A. Prefix range
ARM指令集之数据处理类指令
寻找两个有序数组的中位数(LeetCode 4)
TinyMCE series (III) introduction to common TinyMCE APIs
Promise controls the number of concurrent requests
【深度学习基础】神经网络的学习(4)