自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 报错java.lang.NullPointerException

1.使用JUnit 测试类,运行时一直是有空指针,最后发现是前面的函数返回值,在前面写的return null,最后也忘记改了2.使用JUnit 测试类,还有一种情况,忘记在测试函数前写@Test同理的还有@AfterEach,@BeforeEach3.字符串变量没有初始化,接口类型的对象没有用具体的类初始化。List list; ×List list = new ArrayList (); ✓4.当一个对象的值为空,但你没有判断为空可以加上语句↓试试if(rb!=null);…

2020-07-08 09:45:11 414

原创 Java报错Exception in thread “main“ java.lang.Error: Unresolved compilation problem:

1.大括号没有写全,或者多写2.类名和文件名不一致

2020-07-06 12:03:26 315

原创 python文件报SyntaxError: (unicode error) ’unicodeescape‘ codec can‘t decode bytes in position 2-3: tr

运行python文件的时候竟然报SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: tr这个错误,其实引起这个错误的原因就是转义的问题。假设路径为:sys.path.append('c:\Users\Desktop\python\nh.txt')原因分析:在windows系统当中读取文件路径可以使用,但是在python字符串中\有转义的含义,如\t可代表TAB,\n代表换行,所以我

2020-06-19 23:27:27 140

原创 Dev-C++报错 error: ‘for’ loop initial declarations are only allowed in C99 mode

**error: ‘for’ loop initial declarations are only allowed in C99 mode 的原因及解决办法for(int i=0; i<10; i++){… }**错误**:使用gcc编译代码会报错: > error: 'for' loop initial declarations are only allowed in C99 mode> note: use option -std=c9

2020-06-19 22:17:03 405

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除