草庐IT

java - 无法从类型二对非静态方法 fxn(int) 进行静态引用

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