- 博客(6)
- 收藏
- 关注
原创 [报错]idea无法在测试方法中读取键盘输入
在测试中写了如下方法:@Test public void test2() throws IOException { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); while (true) { System.out.println("请输入字符串:");
2022-03-06 18:56:08 282
原创 [报错]Non-static method ‘XX‘ cannot be referenced from a static context
错误代码public class test1 { public static void main(String[] arguments) { int a=12; int b=plus(a); System.out.print(b); } int plus(int a){ int c=10; return a+c; }}报错解决方法1.在使用的方法前加上sta.
2021-11-03 10:52:01 658
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人