JAVA小知识点记录
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JAVA小知识点记录相关的知识,希望对你有一定的参考价值。
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小知识点记录的主要内容,如果未能解决你的问题,请参考以下文章
错误记录Android Studio 编译报错 ( Could not determine java version from ‘11.0.8‘. | Android Studio 降级 )(代码片段