1. 程式人生 > 資訊 >嚴重危險級別!Apache Log4j 存在遠端程式碼執行漏洞,Java 日誌框架影響範圍極大

嚴重危險級別!Apache Log4j 存在遠端程式碼執行漏洞,Java 日誌框架影響範圍極大

資料型別的應用與整理


public class Demo03 {
    public static void main(String[] args) {
        //整數擴充套件    進位制    電腦;二進位制(0b)   生活中;十進位制   八進位制(0)   十六進位制 (0x)
         int i = 10;//十進位制
         int i1 = 0b10;//二進位制
         int i2 = 010;//八進位制
         int i3 = 0x10;//十六進位制
        System.out.println(i);
        System.out.println(i1);
        System.out.println(i2);
        System.out.println(i3);
        System.out.println("==========================================");
        //==============================================================
        //浮點數拓展?  銀行業務怎麼表示?
        // BigDecimal  數學公式類
        //==============================================================
        //float;  有限的 離散的  存在舍入誤差  大約 接近不等於
        //double;
        //最好完全避免使用浮點數進行比較
        //最好完全避免使用浮點數進行比較
        //最好完全避免使用浮點數進行比較

        float f = 0.1f;//0.1
        double d = 1.0/10;//0.1
        System.out.println(f==d);//false
        System.out.println(f);
        System.out.println(d);

        float d1 = 1231564123165f;
        float d2 = d1+1;
        System.out.println(d1==d2);//true
        System.out.println("==========================================");
        //======================================================
        //字元拓展?
        //===============================================================
        char c1 = 'a';
        char c2 = '草';
        System.out.println(c1);
        System.out.println((int)c1);//強制轉換  將字元型別強制轉換為int型別
        System.out.println(c2);
        System.out.println((int)c2);
        System.out.println("==========================================");
        //所有的字元本質還是字元
        //編碼 Unicode 表(97 = a 65 = A)  佔兩個位元組 (0-65536)  Excel  以前最多2的16次方65536行

        //轉義字元
        *
        //\t  製表符
        //\n  換行符
        System.out.println("Hello\tWorld");
        System.out.println("Hello\nWorld");
        System.out.println("==========================================");


        //
        String sa = new String("hello,world");
        String sb = new String("hello,world");
        System.out.println(sa==sb);
        String sc = "hello,world";
        String sd = "hello,world";
        System.out.println(sc==sd);
        //物件 從記憶體分析

        //布林值擴充套件
        boolean flag = true;
        if (flag==true){}//新手
        if (flag){}//老手
        //Less is More!  程式碼要精簡易讀

    }
}

*