当前位置:网站首页>Copy ‘XXXX‘ to effectively final temp variable
Copy ‘XXXX‘ to effectively final temp variable
2022-07-01 22:59:00 【Xiaoqu classmate】
today , Used in projects lambda The expression encountered a problem :
Copy 'standDatasMap' to effectively final temp variable
Which translates as :xxxx Use valid final variables .
What does that mean ?
Let's have a look first ,lambda Rules for expressions :
- Only references to tags final The outer local variable of , That is to say, it can't be in lambda Internal modification of local variables defined outside the domain , Otherwise it will compile incorrectly .
- Local variables may not be declared as final, But it must not be modified by the following code ( That is to say, recessive has final The semantics of the )
- It is not allowed to declare a parameter or local variable with the same name as a local variable .
Write an example for you , Simple scenario reappearance :
reason :
This is because lambda Expressions do not accept dynamic parameters .
Revised as follows :

We can add one map, Used to receive dynamic parameters , This problem can be solved .
边栏推荐
- Vsphere+ and vsan+ are coming! VMware hybrid cloud focus: native, fast migration, mixed load
- There is no signal in HDMI in computer games caused by memory, so it crashes
- 业务可视化-让你的流程图'Run'起来
- Origin2018安装教程「建议收藏」
- 转载csdn文章操作
- Explain ThreadLocal in detail
- shell 流程控制
- Fiori 应用通过 Adaptation Project 的增强方式分享
- 死锁的处理策略—预防死锁、避免死锁、检测和解除死锁
- [daily training] 326 Power of 3
猜你喜欢
![[untitled]](/img/60/9a56e8b00c386779be13308515b24f.png)
[untitled]

447 Bili Bili noodles warp 1

有些能力,是工作中学不来的,看看这篇超过90%同行

Today's sleep quality record 71 points

Réimpression de l'article csdn

Appium automated testing foundation - Supplement: introduction to desired capabilities parameters

Deadlock handling strategies - prevent deadlock, avoid deadlock, detect and remove deadlock

Appium自动化测试基础 — APPium安装(一)

【Kotlin 第三方 】coil koltin协程图片加载库Coil类似Glide的图片加载第三方

rxjs Observable of 操作符的单步调试分析
随机推荐
The median salary of TSMC's global employees is about 460000, and the CEO is about 8.99 million; Apple raised the price of iPhone in Japan; VIM 9.0 release | geek headlines
Vsphere+ and vsan+ are coming! VMware hybrid cloud focus: native, fast migration, mixed load
业务可视化-让你的流程图'Run'起来
shell 自定义函数
Appium automated testing foundation - Supplement: introduction to desired capabilities parameters
The principle, testing and Countermeasures of malicious software reverse closing EDR
internal field separator
Deep learning -- data operation
陈天奇的机器学习编译课(免费)
Armbain系统根分区空间不足处理
Introduction and use of plantuml
Explain the volatile keyword
Pytorch's code for visualizing feature maps after training its own network
Arlo's thinking after confusion
Map container
旅游管理系统
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
SAP intelligent robot process automation (IRPA) solution sharing
tcpdump命令使用详解
Genicam gentl standard ver1.5 (4) Chapter 5 acquisition engine