摘要:
public class Demo04 { 阅读全文
摘要:
Arrays类常用方法 import java.util.Arrays; public class Demo03 { public static void main(String[] args) { method1(); method2(); method3(); } public static void method1(... 阅读全文
摘要:
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... 阅读全文
摘要:
public class Demo03 { 阅读全文
摘要:
Calendar类常用方法 import java.util.Calendar; import java.util.Date; public class Demo01 { public static void main(String[] args) { //创建Calendar对象(当前日期的日历类对象) Calendar c=Calendar.ge... 阅读全文
摘要:
DateFormat类方法 import java.util.Date; 阅读全文
摘要:
字符串类中涉及正则表达式的常用方法 public class Demo01 { public static void main(String[] args) { //正则检验QQ号 String qq="1162026511"; String regex="[1-9][0-9]{4,9}"; System.out.print... 阅读全文
摘要:
String类 String类构造方法 public class Demo02 { public static void main(String[] args) { method1();//A1 method2();//BC method3();//中a1 method4();//中 } public sta... 阅读全文
摘要:
equals方法 public class Demo01 { public static void main(String[] args) { String str1="abc"; String str2=new String("abc"); //返回布尔值 System.out.println(str1==str2);//... 阅读全文
摘要:
匿名对象 public class School { //静态常量 //一旦赋值终身不变 //类名.变量名调用 public static final String SCHOOL_NAME="清华大学"; int age; } public class Demo { public static void main(String[] args) {... 阅读全文