摘要: 构造方法中给一个true; 如:FileOutputStream stream =new FileOutputStream("e:/jpj.txt",true); 阅读全文
posted @ 2021-07-30 18:39 jakub 阅读(65) 评论(0) 推荐(0)
摘要: FileInputStream stream =new FileInputStream("e:/jpj.txt"); byte[] bytes =new byte[1024]; int by =0; while ((len=stream.read(bytes))!=-1) { System.out. 阅读全文
posted @ 2021-07-30 18:39 jakub 阅读(58) 评论(0) 推荐(0)
摘要: windows:\r\n linu:\n mac:\r 一些高级记事本,是可以识别任意符号的 阅读全文
posted @ 2021-07-30 18:38 jakub 阅读(111) 评论(0) 推荐(0)
摘要: System.out.println(file.isFile()); //获取文件的名字 System.out.println(file.getName()); //上一次编辑他的时间 System.out.println(file.lastModified()); //文件的内容长度 System 阅读全文
posted @ 2021-07-30 18:37 jakub 阅读(65) 评论(0) 推荐(0)
摘要: int类型和String类型的相互转换 int – String String.valueOf int-Integer-toString String – int parseInt Interger.valueof public int intValue() public static int pa 阅读全文
posted @ 2021-07-30 18:36 jakub 阅读(51) 评论(0) 推荐(0)
摘要: 常用的基本进制转换 public static String toBinaryString(int i) // 转成2进制 public static String toOctalString(int i) // 转成8进制 public static String toHexString(int 阅读全文
posted @ 2021-07-30 18:36 jakub 阅读(90) 评论(0) 推荐(0)
摘要: //把另一个集合里面的东西扔到这个集合里 set.addAll(set); //移除所有 set.clear(); //是否为空 set.isEmpty(); //迭代器 set.iterator(); //移除元素 set.remove(""); //移除一堆 set.retainAll(); / 阅读全文
posted @ 2021-07-30 18:35 jakub 阅读(208) 评论(0) 推荐(0)
摘要: integer.sum(a, b); //得到字节类型 integer.byteValue(); //转换成double integer.doubleValue(); //转换成float integer.floatValue(); //转成基本类型int integer.intValue(); / 阅读全文
posted @ 2021-07-30 18:35 jakub 阅读(165) 评论(0) 推荐(0)
摘要: 直接遍历每个对象 for(元素数据类型 变量 : 数组或者Collection集合) {使用变量即可,该变量就是元素} 注:循环前先判断是否为null 阅读全文
posted @ 2021-07-30 18:34 jakub 阅读(58) 评论(0) 推荐(0)
摘要: 解决方案: 通过迭代器添加 for循环 阅读全文
posted @ 2021-07-30 18:33 jakub 阅读(49) 评论(0) 推荐(0)