码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA小知识点记录

时间:2017-09-04 11:55:23      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:result   init   return   mat   国际化   get   分解   5.0   equals   


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小知识点记录

标签:result   init   return   mat   国际化   get   分解   5.0   equals   

原文地址:http://www.cnblogs.com/leewbl/p/7472598.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!