![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
xueyueshuai
这个作者很懒,什么都没留下…
展开
-
java - 平年闰年
/** 根据 年份 月份 获取 每月的天数 31: 1 3 5 7 8 10 12 30: 4 6 9 11 29: 闰年 2月 闰年定义(能被400整除 或者 能被4整除且不能被100整除 的年份) 28 平年 2月 */ public int getDay(int year, int month){ int day = -1; switch(month){ ...原创 2019-08-09 11:47:24 · 153 阅读 · 0 评论 -
java 递归思想
import java.util.Arrays; public class Main { public static void main(String[] args) { var total = 0; for(int i = 1; i<=10; i++) { total += fn(i); } System.out.println(total); System.out.pri...原创 2019-08-10 11:51:35 · 64 阅读 · 0 评论 -
java 冒泡排序
import java.util.Arrays; public class Main { public static void main(String[] args) { int[] arr = new int[] {1,24,231,12,25,24}; sort(arr); System.out.println(Arrays.toString(arr)); ...原创 2019-08-10 17:06:43 · 62 阅读 · 0 评论 -
java 的 json
json字符串 -> JSONObject对象 JSONObject jsonObj = JSON.parseObject("{}"); json字符串 -> JSONArray数组 JSONArray jsonArr = JSON.parseArray("[{},{}]"); java对象 -> JSONObject对象 HashMap user =...原创 2019-09-12 12:11:05 · 72 阅读 · 0 评论