1、List中文、字母、数字排序
Collections.sort(list);//升序
Collections.reverse(list);//倒置成倒序
2、在使用swing开发的时候便于简便安装通常使用Access数据库(office自带),通常也会使用到txt文件。
3、java写入txt文件时换行。
windows下的文本文件换行符:\r\n
linux/unix下的文本文件换行符:\r
Mac下的文本文件换行符:\n
4、java获取本机Ip地址.
InetAddress addr=null;
try {
addr = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
String ip=addr.getHostAddress().toString(); //获取本机ip