摘要: 1、用静态工厂方法代替构造器 获取类的实例时,使用静态工厂方法,返回一个类的静态方法 优势:静态方法有名称,不必每次调用时创建新对象,可以返回原返回类型的任何子类型对象 2、ArrayList的sublist()方法 返回的list不可以强转成为ArrayList 否则会报异常classCastEx 阅读全文
posted @ 2019-02-12 16:50 loveHawin 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1.RestController注解: 2.Spring4.3中引进了{@GetMapping、@PostMapping、@PutMapping、@DeleteMapping、@PatchMapping},来帮助简化常用的HTTP方法的映射,并更好地表达被注解方法的语义。以@GetMapping为例 阅读全文
posted @ 2019-02-12 16:46 loveHawin 阅读(94) 评论(0) 推荐(0) 编辑