String s = "ABCD中國人";
// Byte 數組
byte[] bytes = s.getBytes("UTF-8");
System.out.println(bytes.length); // 目前編碼爲utf-8 爲13字節 byte序列
System.out.println(Arrays.toString(bytes));
String str = new String(bytes,"UTF-8");
System.out.println(str); // 字符串 char序列
字符格式化
FileWriter和FileReader
使用throw new Exception 向外層拋異常
public static void main(String[] args) { Human man = new Human(); try { man.setAge
異常拋出順序從小到大
/** * 拋出異常裏到外-小到大 * @author Heying * */ System.out.println("***
創建文件和目錄
File file = new File("demo.txt"); if(!file.exists()){ file.createNewFile(); }
使用輸入輸出流實現文件複製
FileInputStream fis = new FileInputStream("JAVA_SE.rar"); FileOutputStream fo
高級流實現數據的寫入與讀取
// 1. 寫 DataOutputStream dos = new DataOutputStream( new BufferedOutputStream(
js日期格式化: javascript Date format()
J2EE---Java date format 時間格式化
【linux】循序漸進學運維-基礎篇-修復文件系統實戰
Idea / Eclipse 忽略部分代碼來格式化
Idea / Eclipse 忽略部分代碼來格式化 場景 希望idea/eclipse不要對自己的部分代碼進行格式化, 而使用我們原始的代碼排版 IDEA使用 那個代碼像以下這樣,用註釋
linux 中掛載,格式化NTFS分區
1.安裝fuse (yum) 2.去www.tuxera.com下載ntfs-3g tar zxvf xxxxxxxxxx =====解壓 ./configure make
開源跨平臺數據格式化框架概覽
[Android][安卓]數字格式化顯示,格式化顯示字符串,數字表示
[轉]Android 數字格式化 public static void main(String[] args) { DecimalFormat df = new DecimalFormat();