摘要: import java.io.*; public class BufferedTest { public static void main(String[] args) { FileReader fr = null; FileWriter fw = null; BufferedReader br = 阅读全文
posted @ 2022-09-21 09:57 lai_xinghai 阅读(51) 评论(0) 推荐(0)
摘要: import java.io.*; public class BufferedTest { public static void main(String[] args) { FileInputStream fis = null; FileOutputStream fos = null; Buffer 阅读全文
posted @ 2022-09-21 09:51 lai_xinghai 阅读(112) 评论(0) 推荐(0)
摘要: import java.io.*;import org.junit.Test; /* * FileInputStream和FileOutputStream的使用 */ public class FileInputOutputStreamTest { // 使用字节流FileInputStream处理 阅读全文
posted @ 2022-09-21 09:00 lai_xinghai 阅读(31) 评论(0) 推荐(0)
摘要: import java.io.*; import org.junit.Test; public class FileReaderWriterTest { // 写 @Test public void testWriter() { FileWriter fw = null; try { // 1.实例 阅读全文
posted @ 2022-09-20 11:18 lai_xinghai 阅读(41) 评论(0) 推荐(0)
摘要: import java.util.Arrays; public class StringTest { public static void main(String[] args) throws Exception { // String与字符数组之间的转换 // String --> char[]: 阅读全文
posted @ 2022-09-19 17:16 lai_xinghai 阅读(172) 评论(0) 推荐(0)
摘要: Java 的包装类便是一种特殊的引用数据类型,因为其是与基本数据类型一一对应的。 虽然基本数据类型的效率更高,然后对于面向对象的语言 —— Java,操作对象比操作基本数据类型更为方便,并且基本数据类型有很多局限性,比如对于 int,其有时无法区分默认值 0 还是真的为 0(比如考试成绩为 0 与没 阅读全文
posted @ 2022-09-19 16:26 lai_xinghai 阅读(117) 评论(0) 推荐(0)
摘要: 常用方法一: import org.junit.Test; public class StringMethodTest { @Test public void test1() { String s1 = "HelloWorld"; System.out.println(s1.length());// 阅读全文
posted @ 2022-09-18 10:32 lai_xinghai 阅读(122) 评论(0) 推荐(0)
摘要: String:字符串,使用一对""引起来表示。 1.String声明为final的,不可被继承 2.String实现了Serializable接口:表示字符串是支持序列化的。 实现了ComparabLe接口:表示String可以比较大小 3.String内部定义了final char[] value 阅读全文
posted @ 2022-09-16 14:56 lai_xinghai 阅读(53) 评论(0) 推荐(0)
摘要: import java.util.HashMap; import java.util.Map; public class HashMapTest { public static void main(String[] args) { Map map = new HashMap(); // 添加 map 阅读全文
posted @ 2022-09-15 15:29 lai_xinghai 阅读(48) 评论(0) 推荐(0)
摘要: public class SeasonTest { public static void main(String[] args) { Season spring = Season1.SPRING; // toString() System.out.println(spring); System.ou 阅读全文
posted @ 2022-09-14 16:56 lai_xinghai 阅读(279) 评论(0) 推荐(0)