米字键

博客园 首页 新随笔 联系 订阅 管理

2019年3月23日 #

摘要: import java.io.File; public class FileDOm { /** 2 遍历出C盘下的文件 */ public static void main(String[] args) { //定义要查看的盘符 File fie =new File("c:"); //显示c盘下的所 阅读全文
posted @ 2019-03-23 17:28 米字键 阅读(253) 评论(0) 推荐(0) 编辑

2019年3月22日 #

摘要: import java.util.HashMap;import java.util.Iterator;import java.util.Set;import java.util.Map.Entry;public class MapDome { // Map 嵌套存储Map // aaa // jav 阅读全文
posted @ 2019-03-22 20:19 米字键 阅读(1019) 评论(0) 推荐(0) 编辑

2019年3月21日 #

摘要: /** * 创建线程的第二种方法 实现Runnable接口 * 步骤 * 1、定义一个类实现Runnable接口 * * 2、覆盖Runnable接口中的 run方法 * 将线程要运行的代码放在run方法中 * * 3、同过Thread类建立线程对象 * * 4、将Runnable接口的子类对象作为 阅读全文
posted @ 2019-03-21 16:24 米字键 阅读(295) 评论(0) 推荐(0) 编辑

摘要: public class LinkedlistDome { public static void main(String[] args) { fun(); } public static void fun(){ //创建多态集合 Collection<String >co=new ArrayList 阅读全文
posted @ 2019-03-21 13:47 米字键 阅读(92) 评论(0) 推荐(0) 编辑

摘要: public class GH { public static void main(String[] args) { //使用多态的方式来创建集合 Collection co=new ArrayList<String>(); //分别赋五个值 co.add("张"); co.add("张1"); c 阅读全文
posted @ 2019-03-21 11:57 米字键 阅读(109) 评论(0) 推荐(0) 编辑

摘要: public class Calendardome { //闰年计算 将日历设置到指定的年份 3月1日 add 向前偏移一天 //获取天数 29为闰年 public static void main(String[] args) { fun(); } public static void fun() 阅读全文
posted @ 2019-03-21 11:48 米字键 阅读(168) 评论(0) 推荐(0) 编辑

2019年3月19日 #

摘要: public class Homework { public static void main(String[] args) throws ParseException { lower(); 全部调用 upper(); repalce(); repalce1(); trim(); public st 阅读全文
posted @ 2019-03-19 22:02 米字键 阅读(558) 评论(0) 推荐(0) 编辑

摘要: /* boolean isEmpty(): 判断字符串是不是空串, 如果是空的就返回true */ public class Str { public static void main(String[] args) { // 定义空字符串 String s=""; // 判断是否为空 boolean 阅读全文
posted @ 2019-03-19 21:36 米字键 阅读(838) 评论(0) 推荐(0) 编辑

摘要: // char charAt(int index): 返回索引上的字符 public class Char { public static void main(String[] args) { //定义字符串 String s="Holle"; // 定字符串定义字符串的下标 char s1=s.c 阅读全文
posted @ 2019-03-19 20:45 米字键 阅读(520) 评论(0) 推荐(0) 编辑

摘要: import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DouShaoTian { public static void main(String[] 阅读全文
posted @ 2019-03-19 20:33 米字键 阅读(163) 评论(0) 推荐(0) 编辑