当前位置:网站首页>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 .
边栏推荐
- Mixconv code
- 元宇宙可能成为互联网发展的新方向
- Introduction and use of plantuml
- Explain ThreadLocal in detail
- Fiori 应用通过 Adaptation Project 的增强方式分享
- Using securecrtportable to remotely connect virtual machines
- Pytorch nn.functional.unfold()的简单理解与用法
- 转--利用C语言中的setjmp和longjmp,来实现异常捕获和协程
- Armbain系统根分区空间不足处理
- Single step debugging analysis of rxjs observable of operator
猜你喜欢
El input text field word limit, beyond which the display turns red and input is prohibited
【Kotlin 第三方 】coil koltin协程图片加载库Coil类似Glide的图片加载第三方
正则系列之组和范围(Groups and Ranges)
Metauniverse may become a new direction of Internet development
Today's sleep quality record 71 points
Cut noodles C language
Rust language - Introduction to Xiaobai 05
Turn -- go deep into Lua scripting language, so that you can thoroughly understand the debugging principle
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
思科考试--路由的概念和配置考试
随机推荐
[literacy] deep / shallow, local / global features in machine learning image processing
旅游管理系统
Where can the courses purchased by CSDN be accessed
Introduction and use of plantuml
Congratulations on the release of friends' new book (send welfare)
第三方验收测试有什么好处?专业第三方软件测试机构推荐
Use of locust
Understanding of transactions in MySQL
el-input文本域字数限制,超过显示变红并禁止输入
Quantifiers of regular series
陈天奇的机器学习编译课(免费)
力扣 710. 黑名单中的随机数
Pytorch nn. functional. Simple understanding and usage of unfold()
SAP intelligent robot process automation (IRPA) solution sharing
聊一聊Zabbix都监控哪些参数
104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code
There is no signal in HDMI in computer games caused by memory, so it crashes
Turn -- bring it and use it: share a gadget for checking memory leaks
Favorite transaction code management tool in SAP GUI
Talk about what parameters ZABBIX monitors