上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 31 下一页
摘要: String str6 = "hello"; String str7 = "HELLO"; System.out.println(str6.equalsIgnoreCase(str7)); //不区分大小写比较字符串的内容 阅读全文
posted @ 2020-07-13 17:58 一块 阅读(467) 评论(0) 推荐(0) 编辑
摘要: String str5 = "293陕西力拓888"; System.out.println(str5.startsWith("293")); System.out.println(str5.endsWith("888")); if(str5.startsWith("293")) { System. 阅读全文
posted @ 2020-07-13 17:52 一块 阅读(1397) 评论(0) 推荐(0) 编辑
摘要: String str3 = "helloworld"; System.out.println(str3.substring(3)); System.out.println(str3.substring(2, 8)); String[] arr = str3.split("ow"); for (Str 阅读全文
posted @ 2020-07-13 17:37 一块 阅读(369) 评论(0) 推荐(0) 编辑
摘要: String str3 = "helloworld"; System.out.println(str3.substring(3)); System.out.println(str3.substring(2, 8)); String[] arr = str3.split("ow"); for (Str 阅读全文
posted @ 2020-07-13 17:34 一块 阅读(4681) 评论(0) 推荐(0) 编辑
摘要: String str = " 好好学习,天天向上 "; System.out.println(str.charAt(5)); // 取出指定位置的字符 System.out.println("str的长度为:" + str.length()); // 取得一个字符串的长度 System.out.pr 阅读全文
posted @ 2020-07-13 17:28 一块 阅读(272) 评论(0) 推荐(0) 编辑
摘要: public class StringAPIDemo1 { public static void main(String[] args) { String str = "HELLO"; char c[] = str.toCharArray(); // 将字符串变为字符数组 for (int i = 阅读全文
posted @ 2020-07-13 15:04 一块 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: 匿名对象就是没有明确的给出名字的对象,一般匿名对象只是用一次,而且匿名对象只在堆内存中开辟空间,而不存在栈内存的引用。 匿名对象的作用:基本上作为其他类实例化对象的参数或返回值传递。 语法格式:new 对象名(参数列表); 1.作为参数 class Test {public static void 阅读全文
posted @ 2020-07-09 11:12 一块 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 构造方法的概述和作用:A、给对象的数据(属性)进行初始化。B、构造方法的格式和特点:方法名和类名相同、没有返回值类型,连void都没有、没有具体的返回值return。 构造方法的重载:方法名相同,参数列表不同。 构造方法的定义格式: class 类名称{ 访问权限 类名称(类型1,参数1,类型2,参 阅读全文
posted @ 2020-07-09 10:51 一块 阅读(169) 评论(0) 推荐(0) 编辑
摘要: public class digui { /* * 需求1:从键盘接收一个文件夹路径,统计该文件夹大小 * 需求2:从键盘接收一个文件夹路径,删除该文件夹和文件夹下所有的文件 * */ public static void main(String[] args) { File dir = getDi 阅读全文
posted @ 2020-07-08 22:32 一块 阅读(155) 评论(0) 推荐(0) 编辑
摘要: public class Properties { public static void main(String[] args) throws FileNotFoundException, IOException { test1(); test2(); java.util.Properties pr 阅读全文
posted @ 2020-07-07 22:33 一块 阅读(235) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 31 下一页