米字键

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

2019年3月18日 #

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

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

2019年3月15日 #

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

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

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

2019年3月11日 #

摘要: public class Commodity{ //定义商品类 String name; //定义商品名字 double size; //定义商品尺寸 double price; //定义商品价格 int count; // 定义商品总数量; } import java.util.*; public 阅读全文
posted @ 2019-03-11 21:09 米字键 阅读(356) 评论(0) 推荐(0) 编辑