好的代码习惯

1. 变量定义:int arrowLeft = 0, arrowRight = 0;

2. 三元表达式:char topElement = stack.empty() ? '#' : stack.pop();

3. 获取两个值中较大的一个:maxVal = Math.max(maxVal, arrowLeft+ arrowRight);

4. 初始化数组:new int[]{i,j}

5. Spring工具类:CollectionUtils.isEmpty(list) // LIST,SET

posted @ 2019-05-17 21:04  Jtianlin  阅读(225)  评论(0编辑  收藏  举报