• 第五次实训报告


    实验内容和原理:
    1、 将布尔型、整型、长整型、双精度型作为参数,实例化相应的包装类对象,并输出对象的数值。
    2、 按照“XXXX年XX月XX日 XX时XX分XX秒”的格式,输出当前时间。

    
    package xiejie;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    public class shili {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    	       Boolean b1 = new Boolean(true);
    	       boolean b2 = b1.booleanValue();
    	       Integer i1 = new Integer(97);
    	       int i2 = i1.intValue();
    	       Double d1 = new Double(9.555);
    	       double d2 = d1.doubleValue();
    	       Long l1 = new Long(9597);
    	       long l2 = l1.longValue();
    	       
    	       System.out.println(b2);
    	       System.out.println(i2);
    	       System.out.println(d2);
    	       System.out.println(l2);
    	       
    	       SimpleDateFormat r = new SimpleDateFormat("yyyy年MM月dd日   HH时mm分ss秒"); 
    	       System.out.println(r.format(Calendar.getInstance().getTime()));
    	       }
    	}
    
    

  • 相关阅读:
    JavaScript 弹窗
    创建对象构造器
    DOM事件
    document对象“还在更新”
    JavaScript 闭包
    使用 "use strict" 指令
    constructor 属性
    2019暑期集训第一周小结
    无向图求割边
    矩阵快速幂
  • 原文地址:https://www.cnblogs.com/xiejie95/p/10978343.html
Copyright © 2020-2023  润新知