当前位置:网站首页>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 .
边栏推荐
- Favorite transaction code management tool in SAP GUI
- Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
- Armbain系统根分区空间不足处理
- shell 流程控制
- Origin2018 installation tutorial "recommended collection"
- 思科考试--路由的概念和配置考试
- Happy number [fast and slow pointer of ring PROBLEMS]
- Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
- [QT widget] encapsulates a simple thread management class
- Turn -- go deep into Lua scripting language, so that you can thoroughly understand the debugging principle
猜你喜欢

Introduction and use of plantuml

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

使用3DMax制作一个象棋棋子

Understanding of indexes in MySQL

Today's sleep quality record 71 points

Rust language - Introduction to Xiaobai 05

Tcpdump command usage details

Cut noodles C language

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

转--利用C语言中的setjmp和longjmp,来实现异常捕获和协程
随机推荐
"Trust machine" empowers development
There is no signal in HDMI in computer games caused by memory, so it crashes
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条
Share some feelings of a programmer who has experienced layoffs twice a year
Reprint CSDN article operation
下班前几分钟,我弄清了v-model与.sync的区别
Happy number [fast and slow pointer of ring PROBLEMS]
Fiori applications are shared through the enhancement of adaptation project
SAP intelligent robot process automation (IRPA) solution sharing
Today's sleep quality record 71 points
工作中非常重要的测试策略,你大概没注意过吧
Vsphere+ and vsan+ are coming! VMware hybrid cloud focus: native, fast migration, mixed load
Using emqx cloud to realize one machine one secret verification of IOT devices
Genicam gentl standard ver1.5 (4) Chapter 5 acquisition engine
陈天奇的机器学习编译课(免费)
转--原来gdb的底层调试原理这么简单
el-input文本域字数限制,超过显示变红并禁止输入
Intelligent computing architecture design of Internet
What class loading mechanisms does the JVM have?
友善串口助手使用教程_友善串口调试助手怎么进行配置-友善串口调试助手使用教程…