JavaShuo
欄目
標籤
報錯cannot be referenced from a static context的解決方法
時間 2020-12-21
標籤
報錯踩坑
java
欄目
Java
简体版
原文
原文鏈接
直接貼上代碼 直接上代碼圖,後認識到main方法是一個static方法,class Clerk是一個非靜態的內部類,只能被該類的非靜態方法訪問。否則會報錯。 解決方法: 1.在class前加上static 2.將該類移出來。
>>阅读原文<<
相關文章
1.
【踩坑】報錯 non-static method xxx() cannot be referenced from a static context
2.
「Main.this」 cannot be reference from a static context
3.
IDEA在主函數給其他傳遞參數出現「cannot be referenced from a static context」的解決方法
4.
JSP——【報錯】——The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from r
5.
cannot be resolved to a type解決方法!!!
6.
解決The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class fil
7.
解決Context的startActivity方法報錯
8.
JSP cannot be resolved to a type報錯解決方案
9.
The type java.lang.Class cannot be resolved. It is indirectly referenced from required .(解決思路)
10.
cannot be resolved to a type 錯誤解決
更多相關文章...
•
SVN 解決衝突
-
SVN 教程
•
UDP報文格式詳解
-
TCP/IP教程
•
常用的分佈式事務解決方案
•
SpringBoot中properties文件不能自動提示解決方法
相關標籤/搜索
解決方法
referenced
context
錯誤解決
static
解決方案
解決方式
解決辦法
錯報
報錯
Java
Spring教程
NoSQL教程
PHP教程
算法
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
網絡層協議以及Ping
2.
ping檢測
3.
爲開發者總結了Android ADB 的常用十種命令
4.
3·15 CDN維權——看懂第三方性能測試指標
5.
基於 Dawn 進行多工程管理
6.
缺陷的分類
7.
阿里P8內部絕密分享:運維真經K8S+Docker指南」,越啃越香啊,寶貝
8.
本地iis部署mvc項目,問題與總結
9.
InterService+粘性服務+音樂播放器
10.
把tomcat服務器配置爲windows服務的方法
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
1.
【踩坑】報錯 non-static method xxx() cannot be referenced from a static context
2.
「Main.this」 cannot be reference from a static context
3.
IDEA在主函數給其他傳遞參數出現「cannot be referenced from a static context」的解決方法
4.
JSP——【報錯】——The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from r
5.
cannot be resolved to a type解決方法!!!
6.
解決The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class fil
7.
解決Context的startActivity方法報錯
8.
JSP cannot be resolved to a type報錯解決方案
9.
The type java.lang.Class cannot be resolved. It is indirectly referenced from required .(解決思路)
10.
cannot be resolved to a type 錯誤解決
>>更多相關文章<<