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.
Duang!超快Wi-Fi來襲
2.
機器學習-補充03 神經網絡之**函數(Activation Function)
3.
git上開源maven項目部署 多module maven項目(多module maven+redis+tomcat+mysql)後臺部署流程學習記錄
4.
ecliple-tomcat部署maven項目方式之一
5.
eclipse新導入的項目經常可以看到「XX cannot be resolved to a type」的報錯信息
6.
Spark RDD的依賴於DAG的工作原理
7.
VMware安裝CentOS-8教程詳解
8.
YDOOK:Java 項目 Spring 項目導入基本四大 jar 包 導入依賴,怎樣在 IDEA 的項目結構中導入 jar 包 導入依賴
9.
簡單方法使得putty(windows10上)可以免密登錄樹莓派
10.
idea怎麼用本地maven
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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 錯誤解決
>>更多相關文章<<