当前位置: 首页 > news >正文

百度收录万网空间的网站需要多久佛山医疗网站建设

百度收录万网空间的网站需要多久,佛山医疗网站建设,六安网站建设企业,网站推广的方式有哪些day13 【String类、StringBuilder类】 主要内容 String类常用方法【重点】 String类案例【重点】 StringBuilder类【重点】 StringBuilder类常用方法【重点#xff1a; append】 StringBuilder类案例【理解】 第一章String类 1.1 String类的判断方法 String类实现判断功能…day13 【String类、StringBuilder类】 主要内容 String类常用方法【重点】 String类案例【重点】 StringBuilder类【重点】 StringBuilder类常用方法【重点 append】 StringBuilder类案例【理解】 第一章String类 1.1 String类的判断方法 String类实现判断功能的成员方法没有static关键字修饰必须由String的对象调用1.public boolean equals(Object obj)将此字符串调用equals方法的字符串与指定对象调用方法时传递的参数进行比较严格区分大小写。注意参数Object obj调用equals方法可以传递任意引用类型但是String和其它引用类型比较没有意义结果boolean类型true调用equa1s方法的字符串和方法参数字符串的内容是一模一样的(区分大小写)fa1se调用equa1s方法的字符串和方法参数字符串的内容是不一样的(区分大小写)举例s1.equals(s2)比较字符串对象s1和s2的内容是否一模一样如果一模一样返回true如果不一样返回fa1se2.public boolean equalsIgnoreCase(String str)将此字符串调用equals方法的字符串与指定对象调用方法时传递的参数进行比较忽略大小写。结果boolean类型true调用equa1s方法的字符串和方法参数字符串的内容是一模一样的(忽略大小写)fa1se调用equa1s方法的字符串和方法参数字符串的内容是不一样的(忽略大小写)举例s1.equals(s2)比较字符串对象s1和s2的内容是否一模一样(忽略大小写)如果一模一样返回true如果不一样返回fa1se1.2 String类的其它方法 获取方法:1.public int length():获取字符串的长度(字符串中字符的个数)String底层是字符数组可以获取字符数组的长度:1ength属性使用时后面没有()String的长度:1ength方法使用时后面有()2.String底层采用字符数组字符数组中的每个字符是有索引的从0开始到最大值(数组长度-1)char[] chs{a,b,c,d};获取字符a:chs[0]获取字符b:chs[1]获取字符c:chs[2]获取字符d:chs[3]所以字符串string对象中的每个字符也是有索引的从0开始到最大值(字符串长度-1)字符串String sabcd中每个字符的索引编号字符a的索引编号是0字符b的索引编号是1字符c的索引编号是2字符d的索引编号是3public char charAt(int index):获取调用方法的字符串中索引编号为index处的字符字符a:s.charAt(0)字符b:s.charAt(1)字符c:s.charAt(2)字符d:s.charAt(3)1.3 String类的练习——用户登陆案例 import java.util.Scanner;/*** 需求* 已知用户名和密码请用程序实现模拟用户登录。总共给三次机会登录之后给出相应的提示* 效果* 如果用户名和密码都正确:提示登录成功* 如果用户名或者密码不正确:提示登录失败,同时提示剩余xx次机会,请珍惜* 实现步骤* 1.定义String变量rUserName和rPassword,分别表示已经注册的用户名(rUserName)和密码(rPassword),并分别初始化* 2.创建键盘录入Scanner对象* 3.总共有3次登录机会循环次数确定使用for循环* 3.1获取键盘录入的用户名保存到String变量inputUserName中* 3.2获取键盘录入的密码保存到String变量inputPassword中* 3.3判断如果输入的用户名正确(输入的用户名和注册的用户名相同)并且输入的密码也正确(输入的密码和注册的密码相同)* 3.4提示登录成功,结束for循环* 3.5判断如果输入的用户名不正确(输入的用户名和注册的用户名不相同)或者输入的密码也不正确(输入的密码和注册的密码不相同)* 3.6提示登录失败,同时提示剩余xx次机会,请珍惜*/ public class Demo01Login {public static void main(String[] args) {//1.定义String变量rUserName和rPassword,分别表示已经注册的用户名(rUserName)和密码(rPassword),并分别初始化String rUserNameadmin;String rPasswordadmin;//2.创建键盘录入Scanner对象Scanner sc new Scanner(System.in);//3.总共有3次登录机会循环次数确定使用for循环for (int times 1; times 3; times) {//3.1获取键盘录入的用户名保存到String变量inputUserName中System.out.println(请输入用户名);String inputUserName sc.nextLine();//3.2获取键盘录入的密码保存到String变量inputPassword中System.out.println(用输入密码);String inputPassword sc.nextLine();//3.3判断如果输入的用户名正确(输入的用户名和注册的用户名相同)并且输入的密码也正确(输入的密码和注册的密码相同)if ((inputPassword.equals(rUserName))(inputPassword.equals(rPassword))) {//3.4提示登录成功System.out.println(登录成功);//结束循环break;}else {//3.5判断如果输入的用户名不正确(输入的用户名和注册的用户名不相同)或者输入的密码也不正确(输入的密码和注册的密码不相同)//3.6提示登录失败,同时提示剩余xx次机会,请珍惜System.out.println(用户名或密码有误登录失败);if (times 3) {System.out.println(您的3次免费试用机会已经用尽谢谢使用...);} else {System.out.println(剩余(3-times)次机会,请珍惜);}}}} } 1.4 String类的练习——遍历字符串 import java.util.Scanner;/*** 遍历字符串获取字符串中的每个字符* 需求* 键盘录取一个字符串使用程序实现在控制台遍历该字符串* 实现步骤* 1.创建键盘录入Scanner类的对象* 2.获取键盘录入的字符串保存到String变量str中* 3.使用for循环(主要是获取每个字符的索引)遍历字符串* 3.1通过charAt方法获取到当前索引对应的字符,保存到char变量ch中* 3.2输出char变量ch中的内容*/ public class Demo03EachString {public static void main(String[] args) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的字符串保存到String变量str中System.out.println(请输入一个字符串);String str sc.nextLine();//3.使用for循环(主要是获取每个字符的索引)遍历字符串for (int i 0; i str.length(); i) {//3.1通过charAt方法获取到当前索引对应的字符,保存到char变量ch中char ch str.charAt(i);//3.2输出char变量ch中的内容System.out.println(ch);}} } 1.5 String类的练习——统计字符次数 /*如何判断char变量ch中的字符到底属于哪一类(大写字母,小写字母,数字字符,其它字符)字符呢?思考:char类型的数据/变量,能否进行关系运算呢? 可以滴原因:只要byte/short/char类型数据参加运算会自动转换成int类型*/ public class Demo01CharType {public static void main(String[] args) {char ch b;//运行的时候: 把char类型变量ch以及常量A和Z,转换成int数据,进行运算//char类型转换成int类型,查看ASCII码表if (ch gt; A ch lt; Z) {System.out.println(ch是一个大写字母);} else if (ch gt; a ch lt; z) {System.out.println(ch是一个小写字母);} else if (ch gt; 0 ch lt; 9) {System.out.println(ch是一个数字字符);} else {System.out.println(ch是一个其它字符);}System.out.println(-------------);if (ch gt; 65 ch lt; 90) {System.out.println(ch是一个大写字母);} else if (ch gt; 97 ch lt; 122) {System.out.println(ch是一个小写字母);} else if (ch gt; 48 ch lt; 57) {System.out.println(ch是一个数字字符);} else {System.out.println(ch是一个其它字符);}System.out.println((int)b);/*System.out.println((int)A);System.out.println((int)Z);System.out.println((int)a);System.out.println((int)z);System.out.println((int)0);System.out.println((int)9);*/} } /*需求:键盘录入一个字符串统计该字符串中大写字母字符小写字母字符数字字符及其它字符出现的次数实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的字符串,保存到String变量str中3.定义四个int变量,用来统计不同类型的字符的数量,初始值分别为0int bigCount 0;//统计大写字母字符的数量int smallCount 0;//统计小写字母字符的数量int numCount 0;//统计数字字符的数量int otherCount 0;//统计其它字符的数量4.使用for循环(获取字符串中每个字符的索引编号)遍历字符串4.1使用charAt方法获取字符串中当前索引对应的字符,保存到char变量ch中4.2判断如果char变量ch中是大写字母(chgt;A chlt;Z): bigCount4.3判断如果char变量ch中是小写字母(chgt;a chlt;z): smallCount4.4判断如果char变量ch中是数字字符(chgt;0 chlt;9): numCount4.5判断如果char变量ch中是其它字符(以上三种情况都不成立): otherCount5.循环结束打印结果*/ public class Demo02CharCount {public static void main(String[] args) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的字符串,保存到String变量str中System.out.println(请输入一个字符串: );String str sc.nextLine();//3.定义四个int变量,用来统计不同类型的字符的数量,初始值分别为0int bigCount 0;//统计大写字母字符的数量int smallCount 0;//统计小写字母字符的数量int numCount 0;//统计数字字符的数量int otherCount 0;//统计其它字符的数量//4.使用for循环(获取字符串中每个字符的索引编号)遍历字符串for (int i 0; i lt; str.length(); i) {//4.1使用charAt方法获取字符串中当前索引对应的字符,保存到char变量ch中char ch str.charAt(i);if (ch gt; A ch lt; Z) {//4.2判断如果char变量ch中是大写字母(chgt;A chlt;Z): bigCountbigCount;} else if (ch gt; a ch lt; z) {//4.3判断如果char变量ch中是小写字母(chgt;a chlt;z): smallCountsmallCount;} else if (ch gt; 0 ch lt; 9) {//4.4判断如果char变量ch中是数字字符(chgt;0 chlt;9): numCountnumCount;} else {//4.5判断如果char变量ch中是其它字符(以上三种情况都不成立): otherCountotherCount;}}//5.循环结束打印结果System.out.println(字符串:str中有 bigCount 个大写字母);System.out.println(字符串:str中有 smallCount 个小写字母);System.out.println(字符串:str中有 numCount 个数字字符);System.out.println(字符串:str中有 otherCount 个其它字符);} } 1.6 String类的练习——拼接字符串 /*需求:定义一个方法打印int数组的字符串格式。例如数组为 int[] arr {1,2,3};执行方法后的输出结果为[1, 2, 3]定义方法printArray,打印int数组的字符串格式三要素:1.方法名称: printArray2.参数列表: int[] arr3.返回值类型: void实现步骤:1.打印[,不换行2.使用for循环遍历数组2.1打印数组元素,不换行2.2如果2.1中打印的不是最后一个元素,打印, ,不换行3.打印],换行main方法的实现步骤:1.定义int数组array,并进行初始化2.调用printArray方法,传递int数组array实现打印*/ public class Demo01PrintArray {public static void main(String[] args) {//1.定义int数组array,并进行初始化int[] array {1,2,3};//2.调用printArray方法,传递int数组array实现打印printArray(array);}/*定义方法printArray,打印int数组的字符串格式三要素:1.方法名称: printArray2.参数列表: int[] arr3.返回值类型: void实现步骤:1.打印[,不换行2.使用for循环遍历数组2.1打印数组元素,不换行2.2如果2.1中打印的不是最后一个元素,打印, ,不换行3.打印],换行*/public static void printArray(int[] arr) {//1.打印[,不换行System.out.print([);//2.使用for循环遍历数组for (int i 0; i lt; arr.length; i) {//2.1打印数组元素,不换行System.out.print(arr[i]);//2.2如果2.1中打印的不是最后一个元素,打印, ,不换行if (i ! arr.length - 1) {System.out.print(, );}}//3.打印],换行System.out.println(]);} } /*需求:定义一个方法把 int 数组中的数据按照指定的格式拼接成一个字符串返回调用该方法 并在控制台输出结果。例如数组为 int[] arr {1,2,3};执行方法后的返回的字符串结果为[1, 2, 3]定义方法myToString,获取int数组的字符串格式三要素:1.方法名称: myToString2.参数列表: int[] arr3.返回值类型: String实现步骤:1.定义String变量str,用来拼接字符串,初始值是[2.使用for循环遍历数组2.1向字符串str中拼接数组元素2.2如果2.1中拼接的不是最后一个元素,向字符串str中拼接, 3.for循环结束,向字符串str中拼接]4.返回字符串strmain方法的实现步骤:1.定义int数组array,并进行初始化2.调用方法myToString,传递int数组array,获取对应的字符串,保存到String变量str中3.打印str*/ public class Demo02PrintArray {public static void main(String[] args) {//1.定义int数组array,并进行初始化int[] array {1,2,3};//2.调用方法myToString,传递int数组array,获取对应的字符串,保存到String变量str中//String str myToString(array);//3.打印str//System.out.println(str);System.out.println(myToString(array));}/*定义方法myToString,获取int数组的字符串格式三要素:1.方法名称: myToString2.参数列表: int[] arr3.返回值类型: String实现步骤:1.定义String变量str,用来拼接字符串,初始值是[2.使用for循环遍历数组2.1向字符串str中拼接数组元素2.2如果2.1中拼接的不是最后一个元素,向字符串str中拼接, 3.for循环结束,向字符串str中拼接]4.返回字符串str*/public static String myToString(int[] arr) {//1.定义String变量str,用来拼接字符串,初始值是[String str [;//2.使用for循环遍历数组for (int i 0; i lt; arr.length; i) {//2.1向字符串str中拼接数组元素str arr[i];//2.2如果2.1中拼接的不是最后一个元素,向字符串str中拼接, if (i ! arr.length - 1) {str , ;}}//3.for循环结束,向字符串str中拼接]str ];//4.返回字符串strreturn str;} }1.7 String类的练习——字符串反转 /*需求:定义一个方法实现字符串反转。键盘录入一个字符串调用该方法后在控制台输出结果例如:键盘录入 abc输出结果 cba定义方法reverseString,实现字符串反转,返回反转后的结果字符串三要素:1.方法名称: reverseString2.参数列表: String str3.返回值类型: String实现步骤:1.定义新的String变量s,用来拼接字符串,初始值2.使用for循环倒着遍历(倒着获取索引值)方法参数指定的字符串str2.1获取当前索引对应的字符,保存到char变量ch中2.2把char变量ch中的字符拼接到字符串s的后面3.循环结束,返回字符串smain方法的实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的字符串,保存到String变量str中3.调用reverseString方法传递字符串str,获取反转后的字符串,保存到String变量newStr中4.打印String变量newStr*/ public class Demo03ReverseString {public static void main(String[] args) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的字符串,保存到String变量str中System.out.println(请输入一个字符串: );String str sc.nextLine();//3.调用reverseString方法传递字符串str,获取反转后的字符串,保存到String变量newStr中String newStr reverseString(str);//4.打印String变量newStrSystem.out.println(反转前的字符串: str);System.out.println(反转后的字符串: newStr);}/*定义方法reverseString,实现字符串反转,返回反转后的结果字符串三要素:1.方法名称: reverseString2.参数列表: String str3.返回值类型: String实现步骤:1.定义新的String变量s,用来拼接字符串,初始值2.使用for循环倒着遍历(倒着获取索引值)方法参数指定的字符串str2.1获取当前索引对应的字符,保存到char变量ch中2.2把char变量ch中的字符拼接到字符串s的后面3.循环结束,返回字符串s*/public static String reverseString(String str) {//1.定义新的String变量s,用来拼接字符串,初始值String s ;//2.使用for循环倒着遍历(倒着获取索引值)方法参数指定的字符串strfor (int i str.length() - 1; i gt; 0; i--) {//2.1获取当前索引对应的字符,保存到char变量ch中char ch str.charAt(i);//2.2把char变量ch中的字符拼接到字符串s的后面s ch;}//3.循环结束,返回字符串sreturn s;} }第二章 StringBuilder类 2.1 StringBuilder类的概述 java.lang.String类代表字符串 特点字符串是常量它们的值在创建之后不能更改。 底层是字符数组当字符串内容确定后底层的字符数组已经确定了以后在也无法改变该字符数组不能更换成更大的数组不能改变数组中的内容 String s1hello,s2world,s3java; String s4s1s2s3;helloworlds3;//helloworld是个垃圾helloworldjava; 总结1.因为字符串的不可变性因为字符串拼接都会产生新的字符串底层字符数组2.每次拼接都产生垃圾浪费内存空间3.每次都会产生新的字符串底层字符数组如果进行大批量的字符串拼接时效率非常底下字符串缓冲区可以支持可变的字符串 java.lang.StringBuilder类就是一个字符串缓冲区内部的字符串内容是可以改变的 特点内部字符串内容可以改变 底层是字符数组默认初始化容量长度为16的字符数组随着内容的添加会变成更大的数组内容也可以改变注意当向StringBuilder对象中添加内容时其实就是向它内部的数组中添加内容1.添加内容后数组没有使用完毕留着可以下次继续添加2.如果添加内容后发现数组剩余空间不够使用了StringBuilder内部会实现数组的自动扩容3.首先创建长度为原数组长度2倍2的新数组4.把原数组中的内容拷贝到新数组中5.新数组中剩余空间可以继续添加元素 扩容方式默认长度16第一扩容 16*22 34第二扩容 34*22 70第三扩容 70*22 1422.2 StringBuilder类的构造方法 public StringBuilder() 构造一个空的StringBuilder容器对象,底层是默认程度为16的字符数组 public StringBuilder(String str) 构造一个StringBuilder容器并将构造方法参数指定的字符串添加进去 /*StringBuilder类的常用构造方法public StringBuilder() 构造一个空的StringBuilder容器对象,底层是默认程度为16的字符数组public StringBuilder(String str) 构造一个StringBuilder容器并将构造方法参数指定的字符串添加进去打印引用类型变量,默认调用toString方法StringBuilder类的toString方法,把StringBuilder类内部的字符数组转换成为了字符串*/public class Demo01StringBuilder {public static void main(String[] args) {//public StringBuilder() 构造一个空的StringBuilder容器对象,底层是默认程度为16的字符数组StringBuilder sb new StringBuilder();System.out.println(start sb end);//public StringBuilder(String str) 构造一个StringBuilder容器并将构造方法参数指定的字符串添加进去StringBuilder sb2 new StringBuilder(helloworld);System.out.println(sb2);System.out.println(sb2.toString());} } 2.3 StringBuilder类的成员方法 public StringBuilder append(...) 添加任意类型数据的字符串形式并返回当前对象自身。 public StringBuilder reverse() 返回反转的字符序列 public String toString() 将当前StringBuilder对象转换为String对象。 /*StringBuilder类的常用成员方法(没有static修饰,必须由StringBuilder对象调用)public StringBuilder append(...) 添加任意类型数据的字符串形式并返回当前对象自身。public StringBuilder reverse() 返回反转的字符序列public String toString() 将当前StringBuilder对象转换为String对象。*/public class Demo02StringBuilder {public static void main(String[] args) {//创建StringBuilder对象StringBuilder sb new StringBuilder();//append(...): 把数据原样添加到StringBuilder对象内部的字符数组中sb.append(97);sb.append(a);sb.append(8.8);sb.append(true);sb.append(hello);System.out.println(sb);//97a8.8truehelloSystem.out.println(sb.toString());//97a8.8truehelloSystem.out.println(------------);//创建StringBuilder对象StringBuilder sb2 new StringBuilder(abcdef);System.out.println(sb2);//abcdefSystem.out.println(sb2.toString());//abcdef//reverse(): 把StringBuilder对象内部的字符数组内容进行反转sb2.reverse();System.out.println(sb2);//fedcbaSystem.out.println(sb2.toString());//fedcbaSystem.out.println(------------);//toString(): 把StringBuilder对象转换成String对象String s1 sb.toString();String s2 sb2.toString();System.out.println(s1);System.out.println(s2);} }/*StringBuilder类的append方法和reverse方法,返回值是当前StringBuilder对象(调用该方法的对象)所以:可以进行链式编程*/ public class Demo03StringBuilder {public static void main(String[] args) {StringBuilder sb new StringBuilder(A);StringBuilder sb2 sb.append(B);StringBuilder sb3 sb2.append(C);System.out.println(sb);//ABCSystem.out.println(sb2);//ABCSystem.out.println(sb3);//ABC/*比较引用类型的变量,比较的是地址值返回true: 说明地址值相同,内存空间相同,是同一个对象吧通过结果,发现:sb,sb2,sb3地址值相同,说明指向的是同一个StringBuilder对象append方法是向同一个StringBuilder对象中添加的数据*/System.out.println(sb sb2);//trueSystem.out.println(sb sb3);//trueSystem.out.println(sb2 sb3);//trueSystem.out.println(-----------------);StringBuilder sb4 new StringBuilder(A);//append():添加元素//reverse(): 反转sb4.append(B).append(C).append(D).append(E).append(F).reverse();System.out.println(sb4);//FEDCBA} } 2.4 StringBuilder和String的相互转换 /*StringBuilder和String相互转换思考: 为什么要进行两个类的对象之间的相互转换呢?每个类都有自己的优点和缺点String类:优点: 使用方便,直接用就代表String的对象,不用new缺点: 进行大批量拼接字符串时,效率极低,没有提供反转字符串的方法StringBuilder类:优点: 进行大批量拼接字符串时,效率极高,提供反转字符串的方法缺点: 只能使用new创建对象String转换为StringBuilder:public StringBuilder(String s)通过构造方法就可以实现把 String 转换为 StringBuilderStringBuilder转换为String:public String toString()通过 toString() 就可以实现把 StringBuilder 转换为 String*/ public class Demo04StringBuilder {public static void main(String[] args) {//错误: 左侧是StringBuilder类型,右侧是String对象,类型不匹配//StringBuilder sb Hello;StringBuilder sb new StringBuilder(hello);//对内容进行反转sb.reverse();//错误: 左侧是String类型,右侧是StringBuilder对象,类型不匹配//String s sb;String s sb.toString();System.out.println(s);//olleh} } 2.5 StringBuilder练习——字符串反转 import java.util.Scanner;/*需求:定义一个方法实现字符串反转。键盘录入一个字符串调用该方法后在控制台输出结果例如:键盘录入 abc输出结果 cba定义方法reverseString,实现字符串反转,返回反转后的结果字符串三要素:1.方法名称: reverseString2.参数列表: String str3.返回值类型: String实现步骤(内部借助StringBuilder类的反转功能):1.创建StringBuilder对象sb2.把方法参数String对象str,添加到StringBuilder对象sb中3.StringBuilder对象sb调用reverse方法,实现StringBuilder对象sb内部数据的反转(字符数组)4.StringBuilder对象sb调用toString方法,把StringBuilder对象sb转换成String对象,保存到新的String变量newStr中5.返回新的String变量newStrmain方法的实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的字符串,保存到String变量str中3.调用reverseString方法传递字符串str,获取反转后的字符串,保存到String变量newStr中4.打印String变量newStr*/ public class Demo02ReverseStringBuilder {public static void main(String[] args) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的字符串,保存到String变量str中System.out.println(请输入一个字符串: );String str sc.nextLine();//3.调用reverseString方法传递字符串str,获取反转后的字符串,保存到String变量newStr中String newStr reverseString(str);//4.打印String变量newStrSystem.out.println(反转前的字符串: str);System.out.println(反转后的字符串: newStr);}/*定义方法reverseString,实现字符串反转,返回反转后的结果字符串三要素:1.方法名称: reverseString2.参数列表: String str3.返回值类型: String实现步骤(内部借助StringBuilder类的反转功能):1.创建StringBuilder对象sb2.把方法参数String对象str,添加到StringBuilder对象sb中3.StringBuilder对象sb调用reverse方法,实现StringBuilder对象sb内部数据的反转(字符数组)4.StringBuilder对象sb调用toString方法,把StringBuilder对象sb转换成String对象,保存到新的String变量newStr中5.返回新的String变量newStr*/public static String reverseString(String str) {//1.创建StringBuilder对象sbStringBuilder sb new StringBuilder();//2.把方法参数String对象str,添加到StringBuilder对象sb中sb.append(str);//3.StringBuilder对象sb调用reverse方法,实现StringBuilder对象sb内部数据的反转(字符数组)sb.reverse();//4.StringBuilder对象sb调用toString方法,把StringBuilder对象sb转换成String对象,保存到新的String变量newStr中String newStr sb.toString();//5.返回新的String变量newStrreturn newStr;} } 2.6 StringBuilder练习——字符串拼接 /*需求:定义一个方法把 int 数组中的数据按照指定的格式拼接成一个字符串返回调用该方法 并在控制台输出结果。例如数组为 int[] arr {1,2,3};执行方法后的返回的字符串结果为[1, 2, 3]定义方法myToString,获取int数组的字符串(String)格式三要素:1.方法名称: myToString2.参数列表: int[] arr3.返回值类型: String实现步骤(为了提高效率,使用StringBuilder对象拼接字符串):1.定义StringBuilder对象sb,用来拼接字符串,初始值是[2.使用for循环遍历数组2.1向StringBuilder对象sb中拼接数组元素2.2如果2.1中拼接的不是最后一个元素,向StringBuilder对象sb中拼接, 3.for循环结束,向StringBuilder对象sb中拼接]4.把StringBuilder对象sb转换成String对象,保存String变量str中5.返回String变量strmain方法的实现步骤:1.定义int数组array,并进行初始化2.调用方法myToString,传递int数组array,获取对应的字符串,保存到String变量str中3.打印str*/ public class Demo01StringBuilderPrintArray {public static void main(String[] args) {//1.定义int数组array,并进行初始化int[] array {1,2,3};//2.调用方法myToString,传递int数组array,获取对应的字符串,保存到String变量str中//String str myToString(array);//3.打印str//System.out.println(str);System.out.println(myToString(array));}/*定义方法myToString,获取int数组的字符串格式三要素:1.方法名称: myToString2.参数列表: int[] arr3.返回值类型: String实现步骤(为了提高效率,使用StringBuilder对象拼接字符串):1.定义StringBuilder对象sb,用来拼接字符串,初始值是[2.使用for循环遍历数组2.1向StringBuilder对象sb中拼接数组元素2.2如果2.1中拼接的不是最后一个元素,向StringBuilder对象sb中拼接, 3.for循环结束,向StringBuilder对象sb中拼接]4.把StringBuilder对象sb转换成String对象,保存String变量str中5.返回String变量str*/public static String myToString(int[] arr) {//1.定义StringBuilder对象sb,用来拼接字符串,初始值是[StringBuilder sb new StringBuilder([);//2.使用for循环遍历数组for (int i 0; i lt; arr.length; i) {//2.1向StringBuilder对象sb中拼接数组元素sb.append(arr[i]);//2.2如果2.1中拼接的不是最后一个元素,向StringBuilder对象sb中拼接, if (i ! arr.length - 1) {sb.append(, );}}//3.for循环结束,向StringBuilder对象sb中拼接]sb.append(]);//4.把StringBuilder对象sb转换成String对象,保存String变量str中String str sb.toString();//5.返回String变量strreturn str;} } day14 【ArrayList类】 主要内容 对象数组【理解】 ArrayList类的概念及特点【掌握】 ArrayList类常用方法【掌握】 ArrayList练习【掌握】 ArrayList集合作为方法参数【理解】 ArrayList集合作为方法返回值【理解】遍历ArrayList集合兑现list的快捷键集合对象.fori查看源代码的快捷键:方式一: ctrl 鼠标左键单击要查看源代码的类方式二: ctrl n -- 弹出对话框 -- 输入要查看源代码的类 -- 如果当前选定的不是要找的类,就再次按 ctrl n 当天md文档内容的放大/缩小:视图菜单/方法 or 缩小快捷键: ctrl shift 放大ctrl shift - 缩小 第一章 ArrayList类【理解】 1.1 对象数组 /*需求:使用学生数组存储三个学生对象,并遍历数组实现步骤:1.定义标准的学生Student类2.创建长度为3的存储学生(Student类型)对象的数组array3.创建3个Student类型的对象4.把3个Student类型的对象存储到Student数组array中5.使用for循环遍历Student数组array中回忆:数组的定义格式数据类型[] 数组名称 new 数据类型[长度];比如:int[] array new int[3];左侧int: 规定了数组中存储的数据的类型左侧[]: 代表的是数组创建一个可以存储3个int数字的数组,名称叫做arrayarray[0] 100;//把数字100存储到数组array中索引为0的元素中Student[] array new Student[3];左侧Student: 规定了数组中只能存储的Student类型的数据左侧[]: 代表的是数组类的数据体现形式: 对象*/ public class Demo01StudentArray {public static void main(String[] args) {//2.创建长度为3的存储学生(Student类型)对象的数组arrayStudent[] array new Student[3];//3.创建3个Student类型的对象Student stu1 new Student(张三, 18);Student stu2 new Student(李四, 38);Student stu3 new Student(王五, 28);//引用类型变量保存的是对象的地址值//System.out.println(stu1);//com.itheima01.Student1540e19d//System.out.println(stu2);//com.itheima01.Student677327b6//System.out.println(stu3);//com.itheima01.Student14ae5a5//System.out.println(stu1.getName():::stu1.getAge());//4.把3个Student类型的对象存储到Student数组array中//存到数组元素中的也是对象的地址值array[0] stu1;//把Student类型的对象stu1存储到数组array的索引为0的元素中array[1] stu2;//把Student类型的对象stu2存储到数组array的索引为1的元素中array[2] stu3;//把Student类型的对象stu3存储到数组array的索引为2的元素中//5.使用for循环遍历Student数组array中for (int i 0; i array.length; i) {//5.1获取当前元素Student stu array[i];//5.2打印当前元素//System.out.println(stu);//对象的地址值System.out.println(stu.getName()::::stu.getAge());}} } /*定义标准的学生Student类1.所有成员变量private修饰2.提供空参/满参构造方法3.提供get/set方法*/ public class Student {//1.所有成员变量private修饰private String name;//姓名private int age;//年龄//2.提供空参public Student() {}//满参构造方法public Student(String name, int age) {this.name name;this.age age;}//3.提供get/set方法public String getName() {return name;}public void setName(String name) {this.name name;}public int getAge() {return age;}public void setAge(int age) {this.age age;} } 1.2 对象数组内部图解 需求:需要打印输出张三和181.方式一: 直接通过Student类型的引用变量stu1,调用getName方法和getAge方法2.方式二:通过引用类型的数组array的索引为0的元素,也可以获取张三对象的地址值,从而调用getName方法和getAge方法 思考: 问题1:如何向数组array中添加一个新的Student对象1.数组一旦创建,长度不可以发生改变2.需要创建一个长度更大的新数组(长度为4)3.把原数组中的内容拷贝到新数组中4.把新对象添加到新数组的剩余的空间中5.销毁原数组 问题2:如何从数组array中删除一个Student对象ArrayList集合中删除元素时不是这么实现的1.数组一旦创建,长度不可以发生改变2.判断数组中是否存在要删除的Student对象3.如果存在,创建一个新的数组(长度为2)4.把剩余对象(除了要删除对象以外)拷贝到新数组中5.销毁老数组 总结:因为数组一旦创建,长度永远不可以发生改变,所以如果向数组中添加/删除元素,操作非常麻烦(1)长度不可以改变(2)数组的操作只提供了一个length属性(3)为了解决这样的问题: java提供了集合(ArrayList),把以上的操作都封装成了方法,共我们使用1.3 ArrayList集合的概述和基本使用 java.util.ArrayList类 1.是大小可变的数组的实现存储在内的数据称为元素。2.此类提供一些方法来操作内部存储的元素。3.ArrayList 中可不断添加元素其大小也自动增长。ArrayList集合特点:1.ArrayList集合内部使用数组实现: Object[] elementData 任意引用类型数据都可以存储到ArrayList集合内部2.空参构造创建ArrayList集合,内部默认的数组长度是103.因为数组有索引,所以添加到ArrayList集合内部的元素也有索引,从0开始最大值是长度-1,可以通过索引获取ArrayList集合中元素4.当向ArrayList集合内部添加元素时,集合内部的数组会不断的扩容,创建新数组,把老数组的内容拷贝到新数组中,我们可以继续向新数组中添加元素,但是至于说如何扩容的,如何拷贝数组的,我们不用关心,我们唯一要做的事情,把数据添加到集合当中,而且还要可以从集合中获取/修改/删除元素,就OK java.util.ArrayListE集合类是一个引用类型,使用有三步:1.导包(找到我们要使用的东西)格式: import 包名.类名;java.lang包下的内容可以直接使用,不用导包当前类和要使用的类处于同一个保重,不用导包快捷键: alt 回车2.创建对象格式:类名 对象名 new 类名();数组的创建:int[] array new int[3];int: 表示数组array中存储的数据的类型[]: 表示数组ArrayList集合类的对象创建格式:java.util.ArrayListE类:ArrayList: 是集合的名称:中表示的是集合中可以存储什么类型的数据的注意:创建ArrayList集合对象时,建议使用指定集合中存储数据的类型格式一:创建时没有写,说明该集合对象中可以存储任意引用类型数据ArrayList list new ArrayList();//不建议这么写,因为可以添加任意引用类型数据,使用不方便格式二:ArrayList数据类型 list2 new ArrayList数据类型();//右侧中内容可以省略,但是要保留3.练习:(1)创建ArrayList集合对象list,存储数据的类型是String(2)创建ArrayList集合对象list2,存储数据的类型是Student(3)创建ArrayList集合对象list3,可以存储任意引用类型对象4.常用方法:public boolean add(E e): 将指定的元素e添加到此列表的尾部。E: 就是创建ArrayList集合对象时中指定的类型boolean: 元素是否添加成功添加成功: true添加失败: false对于ArrayList集合而言,此方法永远返回true5.打印ArrayList集合对象list,默认调用toString方法ArrayList集合内部的toString方法把集合元素拼接成字符串并返回 public class Demo01ArrayList {public static void main(String[] args) {//(2)创建ArrayList集合对象list2,存储数据的类型是StudentArrayListStudent list2 new ArrayList();//(3)创建ArrayList集合对象list3,可以存储任意引用类型对象ArrayList list3 new ArrayList();/*list3.add(hello);list3.add(new Student(张三,18));*///(1)创建ArrayList集合对象,存储数据的类型是StringArrayListString list new ArrayList();System.out.println(list);//[]System.out.println(list.toString());//[]list.add(hello);System.out.println(list);//[hello]list.add(world);System.out.println(list);//[hello, world]list.add(java);System.out.println(list);//[hello, world, java]} } 1.4 ArrayList集合的常用方法 ArrayList集合常用方法: 增(C)删(D)改(U)查(R)的方法 CRUD的操作public boolean add(E e) 将指定的元素添加到此集合的尾部。public void add(int index,E e) 在此集合中的指定位置index处插入指定的元素e。public boolean remove(Object o) 删除指定的元素返回删除是否成功true: 删除成功false: 删除失败只能删除一个满足条件的元素public E remove(int index) 移除此集合中指定位置上的元素。返回被删除的元素。public E set(int index,E element) 修改指定索引处的元素返回被修改的元素。public E get(int index) 返回此集合中指定位置上的元素。返回获取的元素。public int size() 返回此集合中的元素数。遍历集合时可以控制索引范围防止越界。public boolean isEmpty(): 判断集合是否为空true: 说明集合为空 没有元素,长度为0false: 说明集合不为空 有元素,长度不为0public void clear(): 清空集合元素public class Demo02ArrayListMethod {public static void main(String[] args) {//创建ArrayList集合对象list,存储数据的类型是StringArrayListString list new ArrayList();//public boolean add(E e) 将指定的元素添加到此集合的尾部。list.add(aaa);//把字符串aaa存储到集合对象list内部的数组的索引为0的元素中list.add(ccc);//把字符串ccc存储到集合对象list内部的数组的索引为1的元素中System.out.println(list);//[aaa, ccc] aaa的索引是0,ccc的索引是1//在ccc前面添加bbb//public void add(int index,E e) 在此集合中的指定位置index处插入指定的元素e。list.add(1,bbb);System.out.println(list);//[aaa, bbb, ccc] aaa的索引是0,bbb的索引是1,ccc的索引是2list.add(ddd);System.out.println(list);//[aaa, bbb, ccc, ddd] aaa的索引是0,bbb的索引是1,ccc的索引是2,ddd的索引是3//删除 ccc//public boolean remove(Object o) 删除指定的元素返回删除是否成功boolean success list.remove(ccc);System.out.println(删除ccc是否成功? success);//trueSystem.out.println(删除ccc后集合内容? list);//[aaa, bbb, ddd] aaa的索引是0,bbb的索引是1,ddd的索引是2//通过索引编号,删除bbb//public E remove(int index) 移除此集合中指定位置上的元素。返回被删除的元素。String whoRemoved list.remove(1);System.out.println(索引1位置的什么元素被删除了呢? whoRemoved);//bbbSystem.out.println(删除索引1对应的元素后集合内容? list);//[aaa, ddd] aaa的索引是0,ddd的索引是1//把aaa修改成aString whoUpdate list.set(0,a);System.out.println(索引0位置的什么元素被修改了呢? whoUpdate);//aaaSystem.out.println(修改索引0位置的元素后,集合内容? list);//[a, ddd] a的索引是0,ddd的索引是1//把ddd修改成dwhoUpdate list.set(1,d);System.out.println(索引1位置的什么元素被修改了呢? whoUpdate);//dddSystem.out.println(修改索引1位置的元素后,集合内容? list);//[a, d] a的索引是0,d的索引是1//获取aString s list.get(0);System.out.println(索引0对应的元素: s);//a//获取ds list.get(1);System.out.println(索引1对应的元素: s);//d//获取集合元素数量的int count list.size();System.out.println(集合中元素的数量: count);//2System.out.println(集合是否为空? list.isEmpty());//false//清空集合元素list.clear();System.out.println(集合中元素的数量: list.size());//0System.out.println(集合是否为空? list.isEmpty());//true} } 第二章 ArrayList练习【理解】 2.1 ArrayList集合存储字符串并遍历 public class Demo03ArrayListEach {public static void main(String[] args) {//创建ArrayList集合对象list,存储数据的类型是StringArrayListString list new ArrayList();//add方法: 添加元素list.add(aaa);//索引编号0list.add(bbb);//索引编号1list.add(ccc);//索引编号2list.add(ddd);//索引编号3System.out.println(list);//[aaa, bbb, ccc, ddd] aaa的索引是0,bbb的索引是1,ccc的索引是2,ddd的索引是3System.out.println(-------------);String s;s list.get(0);System.out.println(s);s list.get(1);System.out.println(s);s list.get(2);System.out.println(s);s list.get(3);System.out.println(s);System.out.println(-------------);//以上代码重复,可以使用for循环for (int i 0; i 4; i) {s list.get(i);System.out.println(s);}System.out.println(-------------);//以上数字4写死了,可以使用集合长度代替for (int i 0; i list.size(); i) {/*s list.get(i);System.out.println(s);*/System.out.println(list.get(i));}} } 2.2 ArrayList集合存储基本数据类型 /*ArrayList集合存储基本数据类型ArrayList集合对象存储基本类型数据时,创建集合对象时,中必须指定的是基本类型对应的引用类型(类,还有一个高大上的名字: 包装类)基本类型 引用类型byte Byteshort Shortint Integer 特殊记忆long Longfloat Floatdouble Doublechar Character 特殊记忆boolean Boolean注意:对于集合的使用,只需要在创建集合对象时,中指定基本类型对应的引用类型,其余的操作都可以按照基本类型完成*/ public class Demo04ArrayListBase {public static void main(String[] args) {//创建ArrayList集合对象list,存储数据的类型是整数(byte/short/int/long)//ArrayListint list new ArrayListint();//错误的//ArrayListshort list new ArrayListshort();//错误的//ArrayListbyte list new ArrayListbyte();//错误的//ArrayListlong list new ArrayListlong();//错误的//创建ArrayList集合对象list,存储数据的类型是整数,中必须指定引用类型ArrayListInteger list new ArrayList();//add方法: 添加数据list.add(100);list.add(200);list.add(300);//遍历for (int i 0; i list.size(); i) {int num list.get(i);System.out.println(num);}} } 2.3 ArrayList集合练习-存储学生对象并遍历 /*需求:创建一个存储学生对象的集合存储3个学生对象使用程序实现在控制台遍历该集合实现步骤:1.创建标准的Student类2.创建ArrayList集合对象list,存储数据的类型是Student3.创建三个Student类型的对象4.ArrayList集合对象list调用add方法添加学生对象到集合容器中5.使用for循环遍历*/ public class Demo02ArrayListStudent {public static void main(String[] args) {//2.创建ArrayList集合对象list,存储数据的类型是StudentArrayListStudent list new ArrayList();//3.创建三个Student类型的对象//4.ArrayList集合对象list调用add方法添加学生对象到集合容器中list.add(new Student(张三, 18));//把Student类型的对象,添加到集合对象list内部的数组的索引为0的元素中list.add(new Student(李四, 38));//把Student类型的对象,添加到集合对象list内部的数组的索引为1的元素中list.add(new Student(王五, 28));//把Student类型的对象,添加到集合对象list内部的数组的索引为2的元素中//5.使用for循环遍历for (int i 0; i list.size(); i) {Student stu list.get(i);//System.out.println(stu);//地址System.out.println(stu.getName()::::stu.getAge());}} } 2.4 ArrayList集合练习_存储学生对象内存图 注意:引用变量保存的是对象的地址值,以后不管是将该变量保存到数组还是集合,都保存的是地址值2.5 ArrayList集合存储Student对象升级版本(键盘录入不定义方法) /*需求:创建一个存储学生对象的集合存储3个学生对象(信息来自键盘录入)使用程序实现在控制台遍历该集合实现步骤:1.创建键盘录入Scanner类的对象2.创建标准的Student类3.创建ArrayList集合对象list,存储数据的类型是Student4.因为要存储3个学生对象,个数确定,使用for循环4.1获取键盘录入的学生的名字,保存到String变量name中4.2获取键盘录入的学生的年龄,保存到int变量age中4.3根据获取到到学生信息创建Student对象stu4.4把Student对象stu存储到ArrayList集合对象list中5.遍历ArrayList集合对象list*/ public class Demo03ArrayListStudentScanner {public static void main(String[] args) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.创建标准的Student类//3.创建ArrayList集合对象list,存储数据的类型是StudentArrayListStudent list new ArrayList();//4.因为要存储3个学生对象,个数确定,使用for循环for (int i 1; i 3; i) {//4.1获取键盘录入的学生的名字,保存到String变量name中System.out.println(请输入第i个学生的名字: );String name sc.next();//4.2获取键盘录入的学生的年龄,保存到int变量age中System.out.println(请输入第i个学生的年龄: );int age sc.nextInt();//4.3根据获取到到学生信息创建Student对象stuStudent stu new Student(name,age);//4.4把Student对象stu存储到ArrayList集合对象list中list.add(stu);}//5.遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//获取当前元素Student stu list.get(i);System.out.println(stu.getName()::::stu.getAge());}} } 2.6 ArrayList集合存储Student对象升级版本(键盘录入定义方法) /*需求:创建一个存储学生对象的ArrayList集合定义一个方法,方法内部通过键盘录入向ArrayList集合对象中添加一个学生对象,main方法中调用三次方法,向ArrayList集合对象中完成3个Student对象的添加,最终遍历ArrayList集合对象定义一个方法addStudent: 方法内部通过键盘录入向ArrayList集合对象中添加一个学生对象三要素:1.方法名称: addStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的学生的姓名信息,保存到String变量name中3.获取键盘录入的学生的年龄信息,保存到int变量age中4.把获取的键盘录入的姓名和年龄信息,封装成Student对象stu5.使用方法参数ArrayList集合对象list调用add方法添加步骤4中封装的Student对象stu到集合对象中main方法实现步骤:1.创建ArrayList集合对象list,存储数据的类型是Student2.调用三次addStudent方法,传递参数步骤1中创建的ArrayList集合对象list,完成向集合对象list中添加了3个Student对象3.遍历ArrayList集合对象list*/ public class Demo04ArrayListStudentMethod {public static void main(String[] args) {//1.创建ArrayList集合对象list,存储数据的类型是StudentArrayListStudent list new ArrayList();//2.调用三次addStudent方法,传递参数步骤1中创建的ArrayList集合对象list,完成向集合对象list中添加了3个Student对象addStudent(list);addStudent(list);addStudent(list);//3.遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//3.1获取当前元素Student stu list.get(i);//3.2打印信息System.out.println(stu.getName()::stu.getAge());}}/*定义一个方法addStudent: 方法内部通过键盘录入向ArrayList集合对象中添加一个学生对象三要素:1.方法名称: addStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的学生的姓名信息,保存到String变量name中3.获取键盘录入的学生的年龄信息,保存到int变量age中4.把获取的键盘录入的姓名和年龄信息,封装成Student对象stu5.使用方法参数ArrayList集合对象list调用add方法添加步骤4中封装的Student对象stu到集合对象中*/public static void addStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的学生的姓名信息,保存到String变量name中System.out.println(请输入学生的姓名: );String name sc.next();//3.获取键盘录入的学生的年龄信息,保存到int变量age中System.out.println(请输入学生的年龄: );int age sc.nextInt();//4.把获取的键盘录入的姓名和年龄信息,封装成Student对象stuStudent stu new Student(name,age);//5.使用方法参数ArrayList集合对象list调用add方法添加步骤4中封装的Student对象stu到集合对象中list.add(stu);return ;//结束方法} } 第三章 ArrayList集合作为方法参数和返回值【重点】 3.1 ArrayList集合作为方法参数 /*ArrayList类型作为方法参数注意: 首次定义Person类,只有一个String name属性ArrayList是引用类型,保存的是集合对象在内存空间的地址值使用ArrayList作为方法参数,传递的是ArrayList集合对象的地址值*/ public class Demo01ArrayListParam {public static void main(String[] args) {//创建ArrayList集合对象list,存储数据的类型PersonArrayListPerson list new ArrayList();//add方法: 添加多个Person对象list.add(new Person(张三));list.add(new Person(李四));list.add(new Person(王五));//调用方法,完成集合的遍历print(list);}/*定义方法print,方法内部打印ArrayList集合中存储的Person类型的数据*/public static void print(ArrayListPerson list) {//使用for循环遍历集合对象for (int i 0; i list.size(); i) {//获取当前元素Person p list.get(i);//打印Person对象的信息System.out.println(p.getName());}} } public class Person {private String name;public Person() {}public Person(String name) {this.name name;}public String getName() {return name;}public void setName(String name) {this.name name;} }3.2 ArrayList集合作为方法参数调用图解 3.3 ArrayList集合作为方法返回值 /*ArrayList类型作为方法返回值注意: 首次定义Person类,只有一个String name属性ArrayList是引用类型,保存的是集合对象在内存空间的地址值使用ArrayList作为方法返回值,返回的是ArrayList集合对象的地址值*/import java.util.ArrayList;public class Demo02ArrayListReturn {public static void main(String[] args) {//调用get方法,获取存储多个Person对象的ArrayList集合对象ArrayListPerson list get();//使用for循环遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//获取当前元素Person p list.get(i);//输出Person对象的信息System.out.println(p.getName());}}/*定义方法get,返回一个存储多个Person对象的ArrayList集合对象*/public static ArrayListPerson get() {//创建ArrayList集合对象list,存储数据的类型PersonArrayListPerson list new ArrayList();//add方法: 添加多个Person对象list.add(new Person(张三));list.add(new Person(李四));list.add(new Person(王五));//返回listreturn list;} } 3.4 ArrayList集合作为方法返回值图解 总结 能够知道集合和数组的区别1.数组长度不可以改变,集合长度可以改变2.数组中可以存储任意类型数据(基本类型和引用类型),集合中只能存储引用类型能够完成ArrayList集合添加字符串并遍历public boolean add(E e): 添加方法参数e到集合末尾处public void add(int index,E e): 在集合指定索引index处,添加方法参数指定元素e尾处public boolean remove(Object obj): 从集合中删除方法参数指定元素objpublic E remove(int index): 从集合中删除方法参数指定位置index处的元素,返回被删除的元素public E set(int index,E e): 把集合中的索引为index处的元素,修改成为方法参数指定元素e,返回修改前的元素public E get(int index): 获取集合中索引index处对应的元素public int size(): 获取集合中元素的数量public void clear(): 清空集合元素public boolean isEmpty(): 判断集合是否为空//创建ArrayList集合对象list,存储数据的类型是StringArrayListString list new ArrayList();//add方法添加元素list.add(hello);list.add(world);list.add(java);//使用for循环遍历for(int i 0;ilist.size();i){sout(list.get(i));}能够完成ArrayList集合添加学生对象并遍历//创建ArrayList集合对象list,存储数据的类型是StudentArrayListStudent list new ArrayList();//add方法添加元素list.add(new Student(zs,18));list.add(new Student(ls,38));list.add(new Student(ww,28));//使用for循环遍历for(int i 0;ilist.size();i){Student stu list.get(i);sout(stu.getName()::stu.getAge());} day15 【学生管理系统】 主要内容 学生管理系统: 基础语法(for/while循环,if-else语句,键盘录入,集合创建,方法定义和调用) 全面复习第一章 学生管理系统【理解】 1.1 项目演示 1.欢迎界面--------欢迎来到学生管理系统--------1 添加学生2 删除学生3 修改学生4 查看所有学生5 退出请输入你的选择12.添加学生功能(1)添加界面:请输入学号:001请输入姓名: zs请输入年龄:18请输入地址:bj添加成功(2)添加成功学生信息后: 重新显示欢迎界面(3)在添加学生信息时,输入的学号id如果已经被使用,会要求重新录入一个新的id,直到录入的id可以使用为止请输入学号:001您输入的id值已经被使用,请重新录入001您输入的id值已经被使用,请重新录入002您输入的id值已经被使用,请重新录入3.查看所有学生(1)显示学生信息界面学号 姓名 年龄 地址001 zs 18 bj002 ls 28 sh4 ww 58 cq(2)成功显示学生信息后: 重新显示欢迎界面(3)如果查看时,没有学生信息,提示先添加,再查看,跳转到欢迎界面先添加学生,再查询--------欢迎来到学生管理系统--------1 添加学生2 删除学生3 修改学生4 查看所有学生5 退出请输入你的选择4.删除学生信息(1)是根据学生id来删除学生信息的,界面:请输入要删除的学生的id001删除成功(2)如果删除学生信息成功: 重新显示欢迎界面(3)如果输入的要删除的学生信息的id不存在: 不会让我们重新输入id,直接跳转到欢迎界面请输入要删除的学生的id001您输入的要删除的学号不存在,无法完成删除操作,请选择其它操作 5.修改学生信息(1)是根据学生id来修改学生信息的,界面: (2)如果修改学生信息成功:重新显示欢迎界面请输入要修改信息的学生的id:002请输入新的姓名: lss请输入新的年龄:16请输入新的地址:shpd修改成功(3)如果输入的要修改的学生信息的id不存在: 不会让我们重新输入id,直接跳转到欢迎界面请输入要修改信息的学生的id:003您输入的要修改的学号不存在,无法完成修改操作,请选择其它操作...欢迎界面5.退出: 结束程序 谢谢使用,欢迎下次光临6.输入[1,5]之外的数据: 目前系统尚不支持您输入的操作,请重新选择...欢迎界面1.2 学生管理系统之学生类的定义 /*定义标准的Java类Student,用来代表学生事物属性:学号,姓名,年龄,地址1.所有成员变量用private修饰2.提供空参构造方法/满参构造方法3.提供get/set方法因为系统中没有对学号和年龄进行数学运算,为了简单起见,定义成String类型*/ public class Student {//1.所有成员变量用private修饰private String id;//学号private String name;//姓名private String age;//年龄private String address;//地址//2.提供空参构造方法public Student() {}//2.提供满参构造方法public Student(String id, String name, String age, String address) {this.id id;this.name name;this.age age;this.address address;}//3.提供get/set方法public String getId() {return id;}public void setId(String id) {this.id id;}public String getName() {return name;}public void setName(String name) {this.name name;}public String getAge() {return age;}public void setAge(String age) {this.age age;}public String getAddress() {return address;}public void setAddress(String address) {this.address address;} } 1.3 学生管理系统之主界面 /*学生管理系统实现步骤:1.定义标准的Java类Student,用来代表学生事物属性:学号,姓名,年龄,地址2.实现打印欢迎界面的功能:对于添加/删除/修改/查看功能成功执行,重新显示欢迎界面,退出功能直接结束程序3.实现添加学生功能:添加成功,重新显示欢迎界面,如果录入的id不存在,会要求重新录入id,直到录入一个可用的id为止4.实现查看所有学生: 查看成功,重新显示欢迎界面,如果没有数据,提示先添加,后查看5.修改学生: 根据id进行修改,修改成功,重新显示欢迎界面,如果录入的id不存在,不允许重新录入id,直接跳转到欢迎界面6.删除学生: 根据id进行删除,删除成功,重新显示欢迎界面,如果录入的id不存在,不允许重新录入id,直接跳转到欢迎界面7.修改bug实现打印欢迎界面:1.创建ArrayList集合对象list,存储数据的类型是Student2.创建键盘录入Scanner类的对象3.以上步骤3-步骤6是一个循环的过程,因为用户使用系统的次数是不确定的,所以使用while(true)4.打印欢迎界面的内容5.获取用户键盘录入的数字,代表用户需要进行的操作,保存到int变量choose中6.因为choose中的数字有51种情况,使用switch判断choose中的值,根据不同的值执行不同的操作java.lang.System类:静态方法(用static修饰的方法,直接由类名调用)public static void exit(int status): 终止当前正在运行的 Java 虚拟机。int status:非0 的状态码:表示异常终止0 的状态码:表示正常终止*/ public class StudentManager01 {public static void main(String[] args) {//1.创建ArrayList集合对象list,存储数据的类型是StudentArrayListStudent list new ArrayList();//2.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//3.以上步骤3-步骤6是一个循环的过程,因为用户使用系统的次数是不确定的,所以使用while(true)while (true) {//4.打印欢迎界面的内容System.out.println(--------欢迎来到学生管理系统--------);System.out.println(1 添加学生);System.out.println(2 删除学生);System.out.println(3 修改学生);System.out.println(4 查看所有学生);System.out.println(5 退出);System.out.println(请输入你的选择);//5.获取用户键盘录入的数字,代表用户需要进行的操作,保存到int变量choose中int choose sc.nextInt();//6.因为choose中的数字有51种情况,使用switch判断choose中的值,根据不同的值执行不同的操作switch (choose) {case 1:System.out.println(添加学生成功);break;case 2:System.out.println(删除学生成功);break;case 3:System.out.println(修改学生成功);break;case 4:System.out.println(查看所有学生成功);break;case 5:System.out.println(谢谢使用,欢迎下次光临);//break;//return;//结束main方法System.exit(0);//正常关闭jvmdefault:System.out.println(目前系统尚不支持您输入的操作,请重新选择);break;}}} }1.4 学生管理系统之添加学生 //把欢迎界面switch中的输出语句替换成以下方法的调用 witch (choose) {//7.根据choose中不同的数字,执行不同的操作case 1://调用方法,完成学生信息的添加addStudent(list);break;//... } /*实现添加学生功能:定义方法addStudent,获取键盘录入的学生信息,封装成学生对象,添加到ArrayList集合中三要素:1.方法名称: addStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的学生信息,分别保存到不同的String变量中3.把获取到的学生信息封装成Student类型的对象stu4.把步骤3封装的Student类型的对象stu添加到方法参数集合对象list中5.提示添加成功*/public static void addStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的学生信息,分别保存到不同的String变量中System.out.println(请输入学号:);String id sc.nextLine();System.out.println(请输入姓名:);String name sc.nextLine();System.out.println(请输入年龄:);String age sc.nextLine();System.out.println(请输入地址:);String address sc.nextLine();//3.把获取到的学生信息封装成Student类型的对象stuStudent stu new Student(id, name, age, address);//4.把步骤3封装的Student类型的对象stu添加到方法参数集合对象list中list.add(stu);//5.提示添加成功System.out.println(添加成功);} 1.5 学生管理系统之查看所有学生 //把欢迎界面switch中的输出语句替换成以下方法的调用 witch (choose) {//...//7.根据choose中不同的数字,执行不同的操作case 4://调用方法,查看所有学生信息printStudent(list);break;//... } /*实现查看所有学生的功能:定义方法printStudent,遍历输出方法参数ArrayList集合对象中的所有Student对象的信息三要素:1.方法名称: printStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.打印表头信息2.使用for循环遍历ArrayList集合对象list2.1获取当前Student对象2.2获取当前Student对象的学号,姓名,年龄,地址信息2.3打印当前Student对象的学号,姓名,年龄,地址信息*/public static void printStudent(ArrayListStudent list) {//1.打印表头信息System.out.println(学号\t\t姓名\t\t年龄\t\t地址);//2.使用for循环遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//2.1获取当前Student对象Student stu list.get(i);//2.2获取当前Student对象的学号,姓名,年龄,地址信息String id stu.getId();String name stu.getName();String age stu.getAge();String address stu.getAddress();//2.3打印当前Student对象的学号,姓名,年龄,地址信息System.out.println(id\t\tname\t\tage\t\taddress);}}1.6 学生管理系统之查看所有学生升级版 //修改printStudent方法 修复一个bug:如果查看时,没有学生信息,提示先添加,再查看,跳转到欢迎界面解决方案:在打印表头信息前,先判断ArrayList集合对象中是否有学生对象如果没有(1.集合是空 2.集合长度是0):打印提示信息先添加,再查看结束方法: 不让方法继续执行如果有:遍历输出 /*实现查看所有学生的功能:定义方法printStudent,遍历输出方法参数ArrayList集合对象中的所有Student对象的信息三要素:1.方法名称: printStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:0.判断如果集合长度为0,打印提示信息先添加,再查看,然后结束方法1.打印表头信息2.使用for循环遍历ArrayList集合对象list2.1获取当前Student对象2.2获取当前Student对象的学号,姓名,年龄,地址信息2.3打印当前Student对象的学号,姓名,年龄,地址信息*/public static void printStudent(ArrayListStudent list) {//0.判断如果集合长度为0,打印提示信息先添加,再查看,然后结束方法if (list.size() 0) {System.out.println(先添加,再查看);return;//结束方法,返回到方法的调用处}//1.打印表头信息System.out.println(学号\t\t姓名\t\t年龄\t\t地址);//2.使用for循环遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//2.1获取当前Student对象Student stu list.get(i);//2.2获取当前Student对象的学号,姓名,年龄,地址信息String id stu.getId();String name stu.getName();String age stu.getAge();String address stu.getAddress();//2.3打印当前Student对象的学号,姓名,年龄,地址信息System.out.println(id\t\tname\t\tage\t\taddress);}} 1.7 学生管理系统之删除学生 //把欢迎界面switch中的输出语句替换成以下方法的调用 witch (choose) {//...//7.根据choose中不同的数字,执行不同的操作case 2://调用方法,删除学生deleteStudent(list);break;//... } /*实现删除学生的功能:根据学生的id,删除对应的学生定义方法deleteStudent,根据键盘录入的学生的id,从ArrayList集合中删除对应的Student类型的对象三要素:1.方法名称: deleteStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的要删除的学生的学号,保存到String变量delId中3.使用for循环遍历ArrayList集合对象list3.1获取当前元素,保存到Student类型变量stu中3.2获取当前元素Student对象stu的学号,保存到String变量id中3.3判断如果键盘录入的学号delId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被删除的学生对象3.4从ArrayList集合对象list中,删除当前学生对象stu3.5提示删除成功3.6结束循环*/public static void deleteStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的要删除的学生的学号,保存到String变量delId中System.out.println(请输入要删除的学生的id);String delId sc.nextLine();//3.使用for循环遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//3.1获取当前元素,保存到Student类型变量stu中Student stu list.get(i);//3.2获取当前元素Student对象stu的学号,保存到String变量id中String id stu.getId();//3.3判断如果键盘录入的学号delId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被删除的学生对象if (id.equals(delId)) {//3.4从ArrayList集合对象list中,删除当前学生对象stulist.remove(i);//3.5提示删除成功System.out.println(删除成功);//3.6结束循环break;}}} 1.8 学生管理系统之修改学生 //把欢迎界面switch中的输出语句替换成以下方法的调用 witch (choose) {//...//7.根据choose中不同的数字,执行不同的操作case 3://调用方法,修改学生updateStudent(list);break;//... } /*实现修改学生的功能:根据学生的id,修改对应的学生定义方法updateStudent,根据键盘录入的学生的id,修改存储在ArrayList集合对象中的学生对象的其它信息三要素:1.方法名称: updateStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的要修改的学生的学号,保存到String变量updateId中3.获取键盘录入的要修改的学生的新的姓名,保存String变量name中4.获取键盘录入的要修改的学生的新的年龄,保存String变量age中5.获取键盘录入的要修改的学生的新的地址,保存String变量address中6.使用for循环遍历ArrayList集合对象7.1获取当前元素,保存到Student类型变量stu中7.2获取当前元素Student对象stu的学号,保存到String变量id中7.3判断如果键盘录入的学号updateId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被修改的学生对象7.4使用当前元素Student对象stu调用set方法,修改其它成员变量的值7.5提示修改成功7.6结束循环*/public static void updateStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的要修改的学生的学号,保存到String变量updateId中System.out.println(请输入要修改信息的学生的id:);String updateId sc.nextLine();//3.获取键盘录入的要修改的学生的新的姓名,保存String变量name中System.out.println(请输入新的姓名:);String name sc.nextLine();//4.获取键盘录入的要修改的学生的新的年龄,保存String变量age中System.out.println(请输入新的年龄:);String age sc.nextLine();//5.获取键盘录入的要修改的学生的新的地址,保存String变量address中System.out.println(请输入新的地址:);String address sc.nextLine();//6.使用for循环遍历ArrayList集合对象for (int i 0; i list.size(); i) {//7.1获取当前元素,保存到Student类型变量stu中Student stu list.get(i);//7.2获取当前元素Student对象stu的学号,保存到String变量id中String id stu.getId();//7.3判断如果键盘录入的学号updateId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被修改的学生对象if (id.equals(updateId)) {//7.4使用当前元素Student对象stu调用set方法,修改其它成员变量的值stu.setName(name);stu.setAge(age);stu.setAddress(address);//7.5提示修改成功System.out.println(修改成功);//7.6结束循环break;}}}//为了修改bug,定义方法 /*定义方法idIsUsed: 判断方法参数指定的id,在方法参数ArrayList集合对象中是否存在(已经被使用)三要素:1.方法名称: idIsUsed2.参数列表: ArrayListStudent list,String id3.返回值类型: boolean实现步骤:1.使用for循环遍历方法参数ArrayList集合对象list1.1获取当前元素,保存到Student类型变量stu中1.2判断方法参数id 如果 等于当前Student对象stu的id值: 说明id被使用过了 ,直接返回true2.for循环结束,执行到这里,说明id没有被使用过,直接返回false*/public static boolean idIsUsed(ArrayListStudent list,String id) {//1.使用for循环遍历方法参数ArrayList集合对象listfor (int i 0; i list.size(); i) {//1.1获取当前元素,保存到Student类型变量stu中Student stu list.get(i);//1.2判断方法参数id 如果 等于当前Student对象stu的id值: 说明id被使用过了 ,直接返回trueif(id.equals(stu.getId())) {return true;}}//2.for循环结束,执行到这里,说明id没有被使用过,直接返回falsereturn false;}1.9 学生管理系统添加操作之学号存在问题 修改bug:在添加学生信息时,输入的学号id如果已经被使用,会要求重新录入一个新的id,直到录入的id可以使用为止请输入学号:001您输入的id值已经被使用,请重新录入001您输入的id值已经被使用,请重新录入002您输入的id值已经被使用,请重新录入解决方案:使用idIsUsed方法,判断id是否被使用过,修改添加学生addStudent方法/*实现添加学生功能:定义方法addStudent,获取键盘录入的学生信息,封装成学生对象,添加到ArrayList集合中三要素:1.方法名称: addStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的学生信息,分别保存到不同的String变量中3.把获取到的学生信息封装成Student类型的对象stu4.把步骤3封装的Student类型的对象stu添加到方法参数集合对象list中5.提示添加成功*/public static void addStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的学生信息,分别保存到不同的String变量中System.out.println(请输入学号:);String id;while (true) {id sc.nextLine();//获取键盘录入的学生的id//判断当前输入的id值是否已经别使用boolean result idIsUsed(list, id);//如果result的值是false,说明id没有被使用过,可以用if (result false) {break;}/*//以上代码可以简化为if(!idIsUsed(list,id)) {break;}*///执行到这里,说明当前输入的id值已经被使用了,得重新录入System.out.println(您输入的id值(id)已经被使用,请重新录入);}System.out.println(请输入姓名:);String name sc.nextLine();System.out.println(请输入年龄:);String age sc.nextLine();System.out.println(请输入地址:);String address sc.nextLine();//3.把获取到的学生信息封装成Student类型的对象stuStudent stu new Student(id, name, age, address);//4.把步骤3封装的Student类型的对象stu添加到方法参数集合对象list中list.add(stu);//5.提示添加成功System.out.println(添加成功);} 1.10 学生管理系统之删除操作学号不存在问题 修改bug:如果输入的要删除的学生信息的id不存在: 不会让我们重新输入id,直接跳转到欢迎界面请输入要删除的学生的id001您输入的要删除的学号不存在,无法完成删除操作,请选择其它操作解决方案:使用idIsUsed方法,判断id是否被使用过(有才能删除,没有无法删除),修改删除学生deleteStudent方法/*实现删除学生的功能:根据学生的id,删除对应的学生定义方法deleteStudent,根据键盘录入的学生的id,从ArrayList集合中删除对应的Student类型的对象三要素:1.方法名称: deleteStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的要删除的学生的学号,保存到String变量delId中2.1调用idIsUsed方法,判断delId如果在ArrayList集合中不存在,直接结束方法3.使用for循环遍历ArrayList集合对象list3.1获取当前元素,保存到Student类型变量stu中3.2获取当前元素Student对象stu的学号,保存到String变量id中3.3判断如果键盘录入的学号delId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被删除的学生对象3.4从ArrayList集合对象list中,删除当前学生对象stu3.5提示删除成功3.6结束循环*/public static void deleteStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的要删除的学生的学号,保存到String变量delId中System.out.println(请输入要删除的学生的id);String delId sc.nextLine();//2.1调用idIsUsed方法,判断delId如果在ArrayList集合中不存在,直接结束方法if(!idIsUsed(list,delId)) {//idIsUsed(list,delId): 返回true,说明存在 返回false,说明不存在System.out.println(您输入的要删除的学号(delId)不存在,无法完成删除操作,请选择其它操作 );return ;}//3.使用for循环遍历ArrayList集合对象listfor (int i 0; i list.size(); i) {//3.1获取当前元素,保存到Student类型变量stu中Student stu list.get(i);//3.2获取当前元素Student对象stu的学号,保存到String变量id中String id stu.getId();//3.3判断如果键盘录入的学号delId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被删除的学生对象if (id.equals(delId)) {//3.4从ArrayList集合对象list中,删除当前学生对象stulist.remove(i);//3.5提示删除成功System.out.println(删除成功);//3.6结束循环break;}}} 1.11 修改bug:如果输入的要修改的学生信息的id不存在: 不会让我们重新输入id,直接跳转到欢迎界面请输入要修改信息的学生的id:003您输入的要修改的学号不存在,无法完成修改操作,请选择其它操作...欢迎界面解决方案:使用idIsUsed方法,判断id是否被使用过(有才能修改,没有无法修改),修改修改学生updateStudent方法/*实现修改学生的功能:根据学生的id,修改对应的学生定义方法updateStudent,根据键盘录入的学生的id,修改存储在ArrayList集合对象中的学生对象的其它信息三要素:1.方法名称: updateStudent2.参数列表: ArrayListStudent list3.返回值类型: void实现步骤:1.创建键盘录入Scanner类的对象2.获取键盘录入的要修改的学生的学号,保存到String变量updateId中2.1调用idIsUsed方法,判断delId如果在ArrayList集合中不存在,直接结束方法3.获取键盘录入的要修改的学生的新的姓名,保存String变量name中4.获取键盘录入的要修改的学生的新的年龄,保存String变量age中5.获取键盘录入的要修改的学生的新的地址,保存String变量address中6.使用for循环遍历ArrayList集合对象7.1获取当前元素,保存到Student类型变量stu中7.2获取当前元素Student对象stu的学号,保存到String变量id中7.3判断如果键盘录入的学号updateId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被修改的学生对象7.4使用当前元素Student对象stu调用set方法,修改其它成员变量的值7.5提示修改成功7.6结束循环*/public static void updateStudent(ArrayListStudent list) {//1.创建键盘录入Scanner类的对象Scanner sc new Scanner(System.in);//2.获取键盘录入的要修改的学生的学号,保存到String变量updateId中System.out.println(请输入要修改信息的学生的id:);String updateId sc.nextLine();//2.1调用idIsUsed方法,判断updateId如果在ArrayList集合中不存在,直接结束方法if(!idIsUsed(list,updateId)) {//idIsUsed(list,updateId): 返回true,说明存在 返回false,说明不存在System.out.println(您输入的修改的学号(updateId)不存在,无法完成修改操作,请选择其它操作 );return ;}//3.获取键盘录入的要修改的学生的新的姓名,保存String变量name中System.out.println(请输入新的姓名:);String name sc.nextLine();//4.获取键盘录入的要修改的学生的新的年龄,保存String变量age中System.out.println(请输入新的年龄:);String age sc.nextLine();//5.获取键盘录入的要修改的学生的新的地址,保存String变量address中System.out.println(请输入新的地址:);String address sc.nextLine();//6.使用for循环遍历ArrayList集合对象for (int i 0; i list.size(); i) {//7.1获取当前元素,保存到Student类型变量stu中Student stu list.get(i);//7.2获取当前元素Student对象stu的学号,保存到String变量id中String id stu.getId();//7.3判断如果键盘录入的学号updateId的值和 当前学生对象的学号id的值相同(内容相同): 说明该学生是要被修改的学生对象if (id.equals(updateId)) {//7.4使用当前元素Student对象stu调用set方法,修改其它成员变量的值stu.setName(name);stu.setAge(age);stu.setAddress(address);//7.5提示修改成功System.out.println(修改成功);//7.6结束循环break;}}}
http://www.tj-hxxt.cn/news/224135.html

相关文章:

  • 上海建网站公司广告设计需要什么软件
  • 上海企业网站建设价格清远新闻最新
  • 简述一下网站的设计流程四川住房和城乡建设部网站首页
  • 学习做网站建设的学校cdq百度指数
  • 扁平化网站设计欣赏品牌策划是什么
  • 泉州做外贸网站使用网站
  • 济南网站建设公司官网如何自己创建网址
  • 成都金融网站建设公司排名电子政务门户网站建设汇报
  • 扬州 网站 建设域名是什么样式的
  • 做微信活动是做网站还是做小程序好wordpress网站维护插件
  • 河南最新新闻头条如何提高网站seo排名
  • 网站建设的部署更新网站的方法
  • php笔记网站太原云起时网站建设
  • 打开网站要密码wordpress如何添加js
  • 阿里巴巴官方网站网站建设scyiyou
  • 网站建设人员分工沈阳专业网站建设公司
  • html购物网站个人网站需不需要备案
  • 滨州网站建设滨州河南省住房和城乡建设厅查询网站首页
  • 网站没有后台怎么更新文章网站的目录怎样做的
  • 怎么做网站代码国家建筑规范标准
  • 化妆品可做的团购网站有哪些做的asp网站手机号码
  • c 网站开发如何每天10点执行任务wordpress发布模块支持5.x
  • 建站之星织梦网站模板如何安装教程
  • 自己怎么做电影网站外链服务
  • 怎么做进入网站js特效佛山有哪些公司
  • 中工信融网站建设杭州网站建设设计公司哪家好
  • 平面设计接单网站有哪些有没有网站做字体变形
  • 做视频网站服务器多少钱wordpress获取当前页面的别名
  • 龙华网站建设设计wordpress 用户接口
  • 网站批量添加内容交换免费连接