摘要: SimpleDateFormat类 示例代码: public class Demo3 { public static void main(String[] args) throws ParseException { //创建对象SimpleDateFormat对象 SimpleDateFormat 阅读全文
posted @ 2020-07-06 18:03 邱大将军 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Calendar类 示例代码: public class Demo3 { public static void main(String[] args) { //创建Calendar对象 Calendar calendar = Calendar.getInstance(); System.out.pr 阅读全文
posted @ 2020-07-06 17:50 邱大将军 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 示例代码: public class Demo3 { public static void main(String[] args) { //创建一个Date类对象 Date date1 = new Date(); System.out.println(date1.toString()); //当前时 阅读全文
posted @ 2020-07-06 11:46 邱大将军 阅读(162) 评论(0) 推荐(0) 编辑
摘要: BigDecimal用法 示例代码: public class Demo3 { public static void main(String[] args) { //double和float采用近似值存储,会产生误差 // double a = 1.0; // double b = 0.9; // 阅读全文
posted @ 2020-07-06 11:27 邱大将军 阅读(144) 评论(0) 推荐(0) 编辑
摘要: String常用方法 示例代码: public class Demo2 { public static void main(String[] args) { String string = "jav a"; // 1. public int length():返回字符串的长度 System.out. 阅读全文
posted @ 2020-07-06 10:41 邱大将军 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 示例代码: public class Demo2 { public static void main(String[] args) { String name1 = "qiu"; //"qiu" 常量存储在字符串常量池中 , name1指向"qiu" String name2 = "zhangsan 阅读全文
posted @ 2020-07-05 14:58 邱大将军 阅读(418) 评论(0) 推荐(0) 编辑
摘要: Integer整数缓冲区 示例代码: public class Demo2 { public static void main(String[] args) { //面试题 Integer integer1 = new Integer(100); Integer integer2 = new Int 阅读全文
posted @ 2020-07-05 14:30 邱大将军 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 包装类 装箱和拆箱 示例代码: public class Demo2 { public static void main(String[] args) { //JDK1.5之前 //1.装箱操作,基本类型转为引用类型的过程 int num1 = 18; //基本类型数据 //使用Integer类创建 阅读全文
posted @ 2020-07-05 14:08 邱大将军 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Object类 1.getClass()方法:获取对象的类型 示例代码 public class Test { public static void main(String[] args) { Me me = new Me("qiudajiang",13); Me me1 = new Me("qiu 阅读全文
posted @ 2020-07-04 14:04 邱大将军 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 匿名内部类 示例代码 接口: public interface Usb { void service(); } 实现类: public class Mouse implements Usb { @Override public void service() { System.out.println( 阅读全文
posted @ 2020-07-04 11:45 邱大将军 阅读(108) 评论(0) 推荐(0) 编辑