
java
零起跑线
目前主要兼顾前后端开发,前端主要使用vue、javascript、typescript,后端主要使用kotlin、Python语言,以及SpringBoot + MybatisPlus框架,数据库一般用MySQL和PostgreSQL
展开
-
java Comparator接口的返回 1,-1,0 的理解
针对jdk8中的List.sort()Comparator(int a, int b)if( a < b ){ // 返回负数或0值,不交换 // 返回正数值,交换ab}if( a > b){ // 返回负数值,交换ab // 返回正数或0值,不交换}if( a == b ){ //返回非0值,会报异常Comparison method violates its general contract!}a - b//正序b - a//倒序Comparator(dou原创 2020-09-21 15:31:16 · 4921 阅读 · 0 评论 -
try AutoClossable catch finally return 顺序测试
public class TestClose implements AutoCloseable{ public int test(){ int x = 1; try{ x += 1; return x + 7; }catch (Exception e){ }finally ...原创 2018-03-14 10:31:10 · 281 阅读 · 0 评论 -
DateTimeFormatter和SimpleDateFormat的parse性能对比
1.单线程性能对比2.多线程性能对比3.线程安全SimpleDateFormat4.线程安全DateTimeFormatter5.结论1.单线程性能对比import java.time.LocalDateTime;import java.time.format.DateTimeFormatter;import java.text.SimpleDateFormat...原创 2018-09-12 13:08:41 · 5743 阅读 · 2 评论