
java
文章平均质量分 66
我从凡间来,到此觅长生
这个作者很懒,什么都没留下…
展开
-
Stringboot创建webservice接口
导入pom文件 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web-services</artifactId> </dependency>1 创建WebServiceConfig配置类@Configurationpublic class WebServiceConfig {//创建原创 2022-04-19 10:09:42 · 184 阅读 · 0 评论 -
java对象判空
Opitonal类是Java提供的为了解决大家平时判断对象是否为空用 会用 null!=obj 这样的方式存在的判断,从而令人头疼导致NPE(Null Pointer Exception 空指针异常),同时Optional的存在可以让代码更加简单,可读性跟高,代码写起来更高效.//常规判断://对象 人//属性有 name,agePerson person=new Person();if (null==person){return “person为null”;}return person;原创 2022-04-19 09:18:22 · 6361 阅读 · 0 评论