默认字符集
Charset.defaultCharset()
用户目录,实际上是jvm执行时的目录
System.getProperty("user.dir")
文件编码,实际上默认字符集就是取的这个值
System.getProperty("file.encoding")
换行编码
System.getProperty("line.separator")
语言环境
System.out.println(Locale.getDefault());
路径分隔符
System.out.println(File.separatorChar);
库文件目录
System.getProperty("java.library.path")
本文介绍了Java中重要的系统属性,包括默认字符集、用户目录、文件编码、换行编码、语言环境、路径分隔符及库文件目录等内容,为开发者提供了一个快速了解Java运行环境的基础指南。
&spm=1001.2101.3001.5002&articleId=51784494&d=1&t=3&u=41eed7d33f204a7e9e32984b720744e6)
1万+

被折叠的 条评论
为什么被折叠?



