当前位置:网站首页>Variable ‘err‘ is accessed from within inner class, needs to be final or effectively final
Variable ‘err‘ is accessed from within inner class, needs to be final or effectively final
2022-04-21 17:40:00 【七八月的天空】
内部类调用外部变量,需要是final类型
String err="";
final String[] errorMsg = new String[50];
invoker.setOutputHandler(new InvocationOutputHandler() {
@Override
public void consumeLine(String s) throws IOException {
if(s.contains("[ERROR]") ){
System.out.println(s);
errorMsg[0] = s;//正确
err=s ;//错误
}
}
});
解决方法:
改成用数组接!!!!
版权声明
本文为[七八月的天空]所创,转载请带上原文链接,感谢
https://blog.csdn.net/x18094/article/details/121496610
边栏推荐
- (for personal use) two requestparam annotations for parameters in remote call
- jedis的基本使用
- 基于SSM的美容院管理系统(附源码+项目展示)
- WIN10便签怎么样开启免打扰时间 如何设置休息日消息免打扰
- MySQL进阶之常用函数
- The second spring of NFT sector - everything you need to know about the early layout of Solana's rising NFT ecosystem
- 诚邀报名丨首期OpenHarmony开发者成长计划分享日
- Vulnerability detection and defense: redis unauthorized access vulnerability recurrence
- 来自TMDB的5000部电影数据集
- 【面试普通人VS高手系列】b树和b+树的理解
猜你喜欢

Spark SQL底层执行流程详解

俄乌冲突引发顾虑 五眼网络安全部门建议盟友增强关键基础设施防护

Plug - in de date de téléphone mobile (ajouter ce que vous aimez)

Insight technology passed the "federal learning" product evaluation of the national financial technology evaluation center of the central bank in the first batch, realizing the dual certification of "

Addition, deletion, modification and query of MySQL advanced table

ASE35P03-ASEMI场效应管35P03
本田北美产品规划发布!Insight混动停产,CR-V、雅阁即将发布

CSP Darknet53

C# ODBC将一个文件夹的文件装载到PostgreSQL数据库BLOB列,并将BLOB列下载到另一个文件夹
How to turn on the undisturbed time with win10 memo how to set the message of rest day to be undisturbed
随机推荐
1044. Longest repeating substring
为什么可以用概率分布密度函数来表示概率?
How to show the ability of structure in the interview?
幹貨 | 實戰演練基於加密接口測試測試用例設計
MOS管和IGBT有什么区别?别傻傻分不清了
DPI发布AI药物研发最新进展报告
MP40N120-ASEMI场效应管MP40N120
onnx效率问题:和Module & DataParallel比较
剑指 Offer II 011. 0 和 1 个数相同的子数组
Structure malloc bug
What is the "responsibility" of fault determination?
数字化时代,企业运维面临现状及挑战分析解读
MSIL 静态类在 IL 定义上和非静态类的差别
短视频APP相关推荐资源位的高扩展高可用工程实践
Fonctions communes pour MySQL Advanced
众昂矿业:萤石资源新的活跃应用领域
本田北美产品规划发布!Insight混动停产,CR-V、雅阁即将发布
第118章 SQL函数 REVERSE
[an article helps you lay a good foundation for routing]
直播app源码,在无法显示图片的基础上添加图片显示功能