当前位置:网站首页>Class, interface, function
Class, interface, function
2022-06-21 17:40:00 【Lighthouse @kuaidao】
Preface
Various technical terms are increasing , To learn programming well, you must first understand technical terms , Then we can make a general judgment on the technology industry as a whole . It is often used for a certain knowledge point in learning, but it is easy to be confused when reading official documents , The corresponding relationship between professional terms and their own knowledge .blog Lie in listing java and kotlin , class 、 Interface 、 function species .


function
Lambda It's an object .
Lambda An expression is a function interface object
lambda expression :block:String.()->Unit
kotlin inline keyword
Every time a higher-order function is called , Will create an anonymous inner class . The function is set to Inline after . The expression of the function will be embedded in the called place at compile time , Achieve the effect of performance optimization . Reduce class loading opportunities .
inline keyword Function compared with ordinary function bytecode and found :
- Use inline after The number of bytecode lines is reduced relative to non inline The bytecode class of the function
- Use inline There will be no... In bytecode kotlin/jvm/lambda Class inheritance , Ordinary functions have inheritance kotlin/jvm/lambda .
Intelj IDE Check bytecode (java and kotlin The way )

kotlin Check bytecode 
Kotlin Function type : Function types have a pair of parentheses , And it has a return value
expression (Int)->Unit
Functional expression (SAM) Interface
An interface with only one abstract method is called a functional interface or SAM( A single abstract method ) Interface . A functional interface can have multiple non abstract members , But there can only be one abstract member .
Statement :
fun interface KRunnable {
fun invoke()
}
Functional interface conversion : Lambda conversion SAM
problem :
1. What is bytecode
2. Basic knowledge of bytecode
3. Higher order functions and Lambda expression
边栏推荐
- The node server res.end() writes Chinese, and the solution to the problem of garbled code in the client
- The next stop of Intelligent Manufacturing: cloud native + edge computing two wheel drive
- FragmentStatePagerAdapter 与FragmentPagerAdapter的区别
- Volcano engine + Yanrong yrcloudfile, driving new growth of data storage
- 20 pyGame module to make a jumping ball game
- 软件测试体系学习及构建(14)-测试基础之软件测试和开发模型概述
- 叩富网开期货账户安全可信吗?
- 稳若磐石的焱融 SaaS 服务平台背后,是数据生态的崛起
- Yrcloudfile of Yanrong technology has completed the compatibility certification with ANTP to jointly create a new blueprint for storage
- [MySQL learning notes 18] constraints
猜你喜欢

Common setting modes

vector的模拟实现

加速云原生应用落地,焱融 YRCloudFile 与天翼云完成兼容性认证

Ease of fire test for silicone rubber glass fiber pipe en45545

MySQL 1055错误-this is incompatible with sql_mode=only_full_group_by解决方案

神经网络七十年:回顾与展望

AS 3744.1标准中提及ISO8191测试,两者测试一样吗?

常见设置模式

Kubernetes + Yanrong SaaS data service platform, personalized demand support has never been lost

【没搞懂路由策略?盘它!】
随机推荐
「运维有小邓」Active Directory批量修改用户
path. join() 、path. Basename() and path extname()
Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which
PTA L3-031 千手观音 (30 分)
Is it safe and reliable to open futures accounts on koufu.com?
module.exports指向问题
泊松抽样与伯努利抽样主要联系与区别
Fragment与Activity 传值
fs. Readfile() and fs writeFile()
一些细节
室内膨胀型防火涂料根据BS 476-21 耐火标准测定需要符合几项?
[MySQL learning notes 19] multi table query
3M mutual aid intelligent contract system development and construction technology
焱融科技 YRCloudFile 与安腾普完成兼容认证,共创存储新蓝图
软件测试体系学习及构建(14)-测试基础之软件测试和开发模型概述
类、接口、函数
[MySQL learning notes 17] sorting out common functions
How to connect the Internet - FTTH
深入理解图注意力机制
The fundamental task of Natural Science