//递归,累计+1,非尾递归 public static int cap(int n) { if (n == 1) { return 1; } return cap((n - 1)) + 1; } //递归,累计+1,尾递归 public static int capTail(int n, int Read More
@Slf4j public class AgeTotal { public static String file = "/Desktop/age.txt"; public static int total = 10000 * 10000; public static int maxAge = 180 Read More
public class DoublePointer { public static int[] a = new int[]{1, 3, 4, 9}; public static int[] b = new int[]{0, 3, 4, 4}; public static void main(Str Read More
public class RepeatBase { public static int[] num = {1,0,8,4,5,6,2,8,1,6}; public static void main(String[] args) { // System.out.println(repeatCheckB Read More
最近在整理代码时,遇到数据库变更,向数据库添加记录,中文读取或存入时变为???。本地MySQL数据库的字符集设置的是utf-8,IDE中项目的字符集也是utf-8,所以在切换数据库之前未发现问题。遇到这个问题后排查了一段时间,最后是在MySQL连接数据库url的参数中加了characterEncod Read More
1、String 与 list 相互转换 List<String> str = new ArrayList<>(); str.add("small");str.add("sun");str.add("shine"); String joinStr = String.join(",", str); S Read More