这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Whatisthereasonbehind“non-staticmethodcannotbereferencedfromastaticcontext”?Cannotmakeastaticreferencetothenon-staticmethodcannotmakeastaticreferencetothenon-staticfield我无法理解我的代码有什么问题。classTwo{publicstaticvoidmain(String[]args){intx=0;System.out.println("x=