摘要: public class Demo04 { 阅读全文
posted @ 2019-01-04 11:47 帅涛 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Arrays类常用方法 import java.util.Arrays; public class Demo03 { public static void main(String[] args) { method1(); method2(); method3(); } public static void method1(... 阅读全文
posted @ 2019-01-04 11:46 帅涛 阅读(91) 评论(0) 推荐(0) 编辑
摘要: System类常用方法 public class Demo01 { public static void main(String[] args) { for(int i=0;i=0,<1的随机数 //四舍五入 System.out.println(Math.round(1.4));//1 System.out.println... 阅读全文
posted @ 2019-01-04 11:44 帅涛 阅读(190) 评论(0) 推荐(0) 编辑
摘要: public class Demo03 { 阅读全文
posted @ 2019-01-04 11:41 帅涛 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Calendar类常用方法 import java.util.Calendar; import java.util.Date; public class Demo01 { public static void main(String[] args) { //创建Calendar对象(当前日期的日历类对象) Calendar c=Calendar.ge... 阅读全文
posted @ 2019-01-04 11:39 帅涛 阅读(120) 评论(0) 推荐(0) 编辑
摘要: DateFormat类方法 import java.util.Date; 阅读全文
posted @ 2019-01-04 11:38 帅涛 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 字符串类中涉及正则表达式的常用方法 public class Demo01 { public static void main(String[] args) { //正则检验QQ号 String qq="1162026511"; String regex="[1-9][0-9]{4,9}"; System.out.print... 阅读全文
posted @ 2019-01-04 11:31 帅涛 阅读(159) 评论(0) 推荐(0) 编辑
摘要: String类 String类构造方法 public class Demo02 { public static void main(String[] args) { method1();//A1 method2();//BC method3();//中a1 method4();//中 } public sta... 阅读全文
posted @ 2019-01-04 11:28 帅涛 阅读(265) 评论(0) 推荐(0) 编辑
摘要: equals方法 public class Demo01 { public static void main(String[] args) { String str1="abc"; String str2=new String("abc"); //返回布尔值 System.out.println(str1==str2);//... 阅读全文
posted @ 2019-01-04 11:26 帅涛 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 匿名对象 public class School { //静态常量 //一旦赋值终身不变 //类名.变量名调用 public static final String SCHOOL_NAME="清华大学"; int age; } public class Demo { public static void main(String[] args) {... 阅读全文
posted @ 2019-01-04 11:03 帅涛 阅读(146) 评论(0) 推荐(0) 编辑
摘要: final关键字 public class Test { public static void main(String[] args) { //final 修饰局部变量 (基本数据类型) //一旦赋值终身不变 final int i; i=1;//只能赋值一次 //final 修饰局部变量 (引用数据类型) ... 阅读全文
posted @ 2019-01-04 10:59 帅涛 阅读(155) 评论(0) 推荐(0) 编辑