当前位置:网站首页>Kotlin notes - popular knowledge points asterisk (*)
Kotlin notes - popular knowledge points asterisk (*)
2022-07-03 12:43:00 【liuhaha1015】
Variable parameter expansion operator
var permissions = arrayOf( Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE ) requestEach(*permissions) public Observable<Permission> requestEach(final String... permissions) { return Observable.just(TRIGGER).compose(ensureEach(permissions)); }
requestEach The method is to receive a String Variable length array of type , We define a permissions The array can be passed in by adding an asterisk
And such as
var temp = arrayOf("1" , "2" , "3") getItem(*temp) fun getItem(vararg str:String){ str.forEach { ToastUtils.showLong(it) } }
vararg Variable length parameter .
边栏推荐
猜你喜欢
Implement verification code verification
记录自己vulnhub闯关记录
剑指Offer03. 数组中重复的数字【简单】
Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?
自抗扰控制器七-二阶 LADRC-PLL 结构设计
The latest version of blind box mall thinkphp+uniapp
Drop down refresh conflicts with recyclerview sliding (swiperefreshlayout conflicts with recyclerview sliding)
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
How to convert a decimal number to binary in swift
【ArcGIS自定义脚本工具】矢量文件生成扩大矩形面要素
随机推荐
Application of ncnn Neural Network Computing Framework in Orange Pi 3 Lts Development Board
JVM内存模型
Eureka自我保护
GaN图腾柱无桥 Boost PFC(单相)七-PFC占空比前馈
Xctf mobile--app1 problem solving
Self made pop-up input box, input text, and click to complete the event.
记录自己vulnhub闯关记录
Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
[download attached] password acquisition tool lazagne installation and use
4. Wireless in vivo nano network: electromagnetic propagation model and key points of sensor deployment
Swift return type is a function of function
基于同步坐标变换的谐波电流检测
alright alright alright
Pytext training times error: typeerror:__ init__ () got an unexpected keyword argument 'serialized_ options'
The future of cloud computing cloud native
Write a simple nodejs script
Xctf mobile--rememberother problem solving
Oh my Zsh + TMUX installation
257. All paths of binary tree
Using swift language features, write a pseudo-random number generator casually