标签:current Suite 功能 dia vat pytho pfile uil print
JDK 12版本包括对Unicode 11.0.0的支持。在发布支持Unicode 10.0.0的JDK 11之后,Unicode 11.0.0引
入了以下JDK 12中包含的新功能:
684 new characters
11 new blocks
7 new scripts.
其中:
684个新字符,包含以下重要内容:
66个表情符号字符(66 emoji characters)
Copyleft符号(Copyleft symbol)
评级系统的半星(Half stars for rating systems)
额外的占星符号(Additional astrological symbols)
象棋中国象棋符号(Xiangqi Chinese chess symbols)
7个新脚本:
Hanifi Rohingya
Old Sogdian
Sogdian
Dogra
Gunjala Gondi
Makasar
Medefaidrin
11个新块,包括上面列出的新脚本的7个块和以下现有脚本的4个块:
格鲁吉亚扩展(Georgian Extended)
玛雅数字(Mayan Numerals)
印度Siyaq数字(Indic Siyaq Numbers)
国际象棋符号(Chess Symbols)
NumberFormat 添加了对以紧凑形式格式化数字的支持。
@Test
public void testCompactNumberFormat(){
var cnf = NumberFormat.getCompactNumberInstance(Locale.CHINA,
NumberFormat.Style.SHORT);
System.out.println(cnf.format(1_0000));
System.out.println(cnf.format(1_9200));
System.out.println(cnf.format(1_000_000));
System.out.println(cnf.format(1L << 30));
System.out.println(cnf.format(1L << 40));
System.out.println(cnf.format(1L << 50));
}
输出
1万
2万
100万
11亿
1兆
1126兆
var result = "foo"
.transform(input -> input + " bar")
.transform(String::toUpperCase)
System.out.println(result); // FOO BAR
private static void testIndent() {
System.out.println("======test java 12 indent======");
String result = "Java\n Python\nC++".indent(3);
System.out.println(result);
}
public void testFilesMismatch() throws IOException {
FileWriter fileWriter = new FileWriter("tmp\\a.txt");
fileWriter.write("a");
fileWriter.write("b");
fileWriter.write("c");
fileWriter.close();
FileWriter fileWriterB = new FileWriter("tmp\\b.txt");
fileWriterB.write("a");
fileWriterB.write("1");
fileWriterB.write("c");
fileWriterB.close();
System.out.println(Files.mismatch(Path.of("tmp/a.txt"),Path.of("tmp/b.txt")));
}
标签:current Suite 功能 dia vat pytho pfile uil print
原文地址:https://www.cnblogs.com/androidsuperman/p/11766483.html