米字键

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

随笔分类 -  JAVEE计算

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

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

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

摘要:public class Work { /* * 获取一个字符串中,另一个字符串出现的次数 * 思想: * 1. indexOf到字符串中到第一次出现的索引 * 2. 找到的索引+被找字符串长度,截取字符串 * 3. 计数器++ */ public static void main(String[] 阅读全文
posted @ 2019-03-18 22:16 米字键 阅读(857) 评论(0) 推荐(0)

摘要:public class ZongHe { public static void main(String[] args) { function1(); function2(); function3(); function4(); function5(); function6(); function7 阅读全文
posted @ 2019-03-18 21:59 米字键 阅读(255) 评论(0) 推荐(0)

摘要:public class ZongHe { public static void main(String[] args) { //调用function; function(); } //int length();返回的是字符串长度 public static void function(){ Str 阅读全文
posted @ 2019-03-18 21:49 米字键 阅读(1337) 评论(0) 推荐(0)

摘要:public class BubleSort { public static void main(String[] args) { int[] arr = {12,2,25,89,5}; //定义数组元素 bubbleSort(arr); //调用冒泡排序 printArray(arr); //调用 阅读全文
posted @ 2019-03-13 21:31 米字键 阅读(838) 评论(0) 推荐(0)

摘要:public class Test { public static void main(String[] args) { int[] arr = {12,69,852,25,89,588}; //定义数组 selectS(arr); //调用选择排序 printS(arr); //调用遍历打印 } 阅读全文
posted @ 2019-03-13 21:19 米字键 阅读(432) 评论(0) 推荐(0)