当前位置:网站首页>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 .
边栏推荐
- Turn -- bring it and use it: share a gadget for checking memory leaks
- internal field separator
- shell 自定义函数
- What class loading mechanisms does the JVM have?
- Share some feelings of a programmer who has experienced layoffs twice a year
- 元宇宙可能成为互联网发展的新方向
- 若干互联网暴露面的收敛及处置建议
- Selection of all-optical technology in the park - Part 2
- map容器
- 工作中非常重要的测试策略,你大概没注意过吧
猜你喜欢

Hide the creation and use of users

Cisco -- an external tool for WAN's concept examination

Cutefishos system~

Digital currency: far-reaching innovation

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received

元宇宙可能成为互联网发展的新方向

思科--WAN 的概念考试外部工具

Turn -- use setjmp and longjmp in C language to realize exception capture and collaboration

Demo program implementation of QT version Huarui camera

Appium automation test foundation - appium installation (I)
随机推荐
转载csdn文章操作
激发新动能 多地发力数字经济
若干互联网暴露面的收敛及处置建议
【无标题】
Explain the use of locksupport in detail
[JUC learning road day 8] condition
locust的使用
Fiori 应用通过 Adaptation Project 的增强方式分享
tcpdump命令使用详解
Turn -- bring it and use it: share a gadget for checking memory leaks
104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code
Tcpdump command usage details
The principle, testing and Countermeasures of malicious software reverse closing EDR
Deadlock handling strategies - prevent deadlock, avoid deadlock, detect and remove deadlock
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
Mixconv code
Understanding of inverted residuals
Little red book scheme jumps to the specified page
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
Pytorch nn.functional.unfold()的简单理解与用法