1. 程式人生 > >JAVA小知識點記錄

JAVA小知識點記錄

val ++ returns 選擇 bytes undle note utf long


1.Mah.ceil()
     * Returns the smallest (closest to negative infinity)
     * {@code double} value that is greater than or equal to the
     * argument and is equal to a mathematical integer. Special cases:
     * If the argument value is already equal to a
     * mathematical integer, then the result is the same as the
     * argument.If the argument is NaN or an infinity or
     * positive zero or negative zero, then the result is the same as
     * the argument. If the argument value is less than zero but
     * greater than -1.0, then the result is negative zero.Note
     * that the value of {@code Math.ceil(x)} is exactly the
     * value of {@code -Math.floor(-x)}.
2.i= i ++;
3.
        Integer a =5;
        Long b = 5L;
        Double c = 5.0;
        System.out.print(a.equals(b));
        System.out.print(a==c);
        byte d = (byte) 128;
        byte e = 128;// error
4.Java一律采用Unicode編碼方式,每個字符無論中文還是英文字符都占用2個字節。
將字符串S以其自身編碼方式分解為字節數組,再將字節數組以你想要輸出的編碼方式重新編碼為字符串。
例:String newUTF8Str = new String(oldGBKStr.getBytes("GBK"), "UTF8");
Java虛擬機中通常使用UTF-16的方式保存一個字符
ResourceBundle能夠依據Local的不同,選擇性的讀取與Local對應後綴的properties文件,以達到國際化的目的。

JAVA小知識點記錄