米字键

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

2019年3月19日 #

摘要: // 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 米字键 阅读(529) 评论(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 米字键 阅读(175) 评论(0) 推荐(0)

2019年3月18日 #

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

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

2019年3月15日 #

摘要: /* 1 定义一个员工类 所有的子类都抽取(抽象类) Employee 属性:姓名 工号(生成get set ) 方法:工作 抽象 2 定义一个研发类员工 Develop abstract 继承Employee 抽象类的方法 work(); 3要求定义一个EE工程师类 工号 姓名 工作:开发拼多多 阅读全文
posted @ 2019-03-15 16:24 米字键 阅读(745) 评论(0) 推荐(0)

摘要: //创建一个动物类 public class Animal { //设置动物的属性 String color; int leg=4; String chi="吃饭";} //创建一个猫类继承动物类 public class Cat extends Animal { // 创建公共显示方法猫的特有属性 阅读全文
posted @ 2019-03-15 15:48 米字键 阅读(635) 评论(0) 推荐(0)

摘要: package animal; //创建一个抽象动物类 public abstract class Animal { /* 已知猫类和狗类: 属性:毛的颜色,腿的个数 行为:吃饭 猫特有行为:抓老鼠catchMouse 狗特有行为:看家lookHome */ //设置他们共同的属性 String c 阅读全文
posted @ 2019-03-15 15:00 米字键 阅读(886) 评论(0) 推荐(0)

2019年3月13日 #

摘要: 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 米字键 阅读(808) 评论(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 米字键 阅读(407) 评论(0) 推荐(0)