摘要: import java.math.BigDecimal;public class Demo01 { public static void main(String[] args){ double d1=1.0; double d2=0.9; System.out.println(d1-d2);//0. 阅读全文
posted @ 2023-02-15 18:21 惊鸿宴远赴人间 阅读(17) 评论(0) 推荐(0)
摘要: import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;public class Demo01 { public static void main(String[] args) t 阅读全文
posted @ 2023-02-15 18:00 惊鸿宴远赴人间 阅读(22) 评论(0) 推荐(0)
摘要: import java.util.Calendar;public class Application { public static void main(String[] args) { //1.创建一个Calendar Calendar calendar = Calendar.getInstanc 阅读全文
posted @ 2023-02-15 17:40 惊鸿宴远赴人间 阅读(34) 评论(0) 推荐(0)
摘要: import java.util.Date;public class Demo01 { public static void main(String[] args) { /* 1秒=1000毫秒 1毫秒=1000微秒 1微秒=1000纳秒 */ //1.创建Date对象 //当前时间 Date da 阅读全文
posted @ 2023-02-15 17:39 惊鸿宴远赴人间 阅读(21) 评论(0) 推荐(0)
摘要: public class Application { public static void main(String[] args) { //StringBuffer和StringBuilder的使用(一般使用StringBuilder) //StringBuffer和StringBuilder 与S 阅读全文
posted @ 2023-02-15 16:05 惊鸿宴远赴人间 阅读(20) 评论(0) 推荐(0)
摘要: public class Application { public static void main(String[] args) { String str="this is a text"; //1 将str中的单词单独获取出来 String[] s = str.split(" "); for ( 阅读全文
posted @ 2023-02-15 12:49 惊鸿宴远赴人间 阅读(20) 评论(0) 推荐(0)
摘要: public class Demo01 { public static void main(String[] args) { String name="hello";//“hello”常量存储在字符串池中,字符串池在方法区中,字符串字面值可以共享 name="张三";//"张三"赋给name变量。给 阅读全文
posted @ 2023-02-15 12:49 惊鸿宴远赴人间 阅读(85) 评论(0) 推荐(0)