摘要: 生成6位随机正整数 使用Random生成随机数 public static String getStringRandom() { Random random = new Random(); String str = String.valueOf(random.nextInt(9)); for (int i = 0; i 阅读全文
posted @ 2023-11-25 21:11 残城碎梦 阅读(149) 评论(0) 推荐(0)
摘要: 反射工具类 import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Arra 阅读全文
posted @ 2023-11-25 20:19 残城碎梦 阅读(37) 评论(0) 推荐(0)
摘要: apache的集合工具类CollectionUtils org.apache.commons.collections包下的CollectionUtils工具类。 <!--CollectionUtils --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-co 阅读全文
posted @ 2023-11-25 19:59 残城碎梦 阅读(719) 评论(0) 推荐(0)
摘要: 文件的压缩与解压缩 Java中提供了ZipOutputStream和GZIPOutputStream类供文件压缩使用。 import java.io.*; import java.nio.charset.Charset; import java.util.Enumeration; import java.util.zi 阅读全文
posted @ 2023-11-25 19:26 残城碎梦 阅读(39) 评论(0) 推荐(0)
摘要: 用5种方式发起HTTP请求 通过JDK网络类Java.net.HttpURLConnection <!--jackson--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> 阅读全文
posted @ 2023-11-25 14:37 残城碎梦 阅读(125) 评论(0) 推荐(0)
摘要: Junit <!--junit--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> Apac 阅读全文
posted @ 2023-11-25 11:28 残城碎梦 阅读(703) 评论(0) 推荐(0)