当前位置:网站首页>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 .
边栏推荐
- Metauniverse may become a new direction of Internet development
- Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
- ECMAScript 2022 正式发布,有你了解过的吗?
- 力扣 710. 黑名单中的随机数
- Happy number [fast and slow pointer of ring PROBLEMS]
- 死锁的处理策略—预防死锁、避免死锁、检测和解除死锁
- 软件测试之「 性能测试」总结,新手上路必会知识点
- What are the benefits of third party acceptance testing? Recommended by professional third-party software testing institutions
- 转--原来gdb的底层调试原理这么简单
- Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
猜你喜欢

Reprint CSDN article operation

Chen Tianqi's machine learning compilation course (free)

Daily question brushing record (10)

死锁的处理策略—预防死锁、避免死锁、检测和解除死锁

Share some feelings of a programmer who has experienced layoffs twice a year

正则系列之组和范围(Groups and Ranges)

Explain JMM in detail

Digital currency: far-reaching innovation

轉載csdn文章操作

Explain the use of locksupport in detail
随机推荐
常见的二十种软件测试方法详解(史上最全)
死锁的处理策略—预防死锁、避免死锁、检测和解除死锁
Metauniverse may become a new direction of Internet development
数字货币:影响深远的创新
Vsphere+ and vsan+ are coming! VMware hybrid cloud focus: native, fast migration, mixed load
tcpdump命令使用详解
下班前几分钟,我弄清了v-model与.sync的区别
[daily training] 66 add one-tenth
旅游管理系统
转--利用C语言中的setjmp和longjmp,来实现异常捕获和协程
Mysql 5.7 实现 rank 排名
Fiori 应用通过 Adaptation Project 的增强方式分享
使用3DMax制作一个象棋棋子
【扫盲】机器学习图像处理中的深层/浅层、局部/全局特征
ESP自动下载电路设计
Map container
What are the benefits of third party acceptance testing? Recommended by professional third-party software testing institutions
Appium automation test foundation - appium installation (I)
rxjs Observable of 操作符的单步调试分析
MySQL -- index of MyISAM storage engine