- 博客(1)
- 收藏
- 关注
转载 报错解决方法:Non-static method '*' cannot be referenced from a static context
翻译:在静态上下文中不能引用非静态方法’*’ 造成原因 直接调用了其他包内的非静态方法。 解决方法1 将包 com.test.package1 中 TestMethod 类的非静态方法 test() 改为静态方法。 解决方法2 引用包 com.test.package1 中 TestMethod 类的 test()方法时,先实例化一个 TestMethod 类的对象,再用对象引用方法。 ...
2019-04-24 10:18:04 8060
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人