2019.6.5

1111



public class num1 {
    public static void main(String[]args){
        Boolean numbool = new Boolean(false);
        Character numchar = new Character('Z');
        Integer numint = new Integer(251);
        Long numlong = new Long(4757);
        Double numdou = new Double(3.1415926);
        
        System.out.println(numbool);
        System.out.println(numint);
        System.out.println(numdou);
        System.out.println(numlong);
        System.out.println(numchar);

    }
}


2019.6.5_第1张图片

2222

import java.text.SimpleDateFormat;
import java.util.*;
public class num2 { 
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println("时间:"+date);
        String strDate = date.toString();
        String year = strDate.substring(24,28);
        String month = strDate.substring(4,7);
        String day = strDate.substring(9,10);
        String hour = strDate.substring(11,13);
        String min = strDate.substring(14,16);
        String sec = strDate.substring(17,19);
        
        System.out.print(year+"年");
        System.out.print(month+"月");
        System.out.print(day+"日   ");
        System.out.print(hour+"时");
        System.out.print(min+"分");
        System.out.println(sec+"秒");
        
        SimpleDateFormat dateformat1=new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒 E");
        String a1 = dateformat1.format(new Date());
        System.out.println("时间:"+a1);
    }
}

2019.6.5_第2张图片

你可能感兴趣的:(2019.6.5)