日期:2014-05-20 浏览次数:20913 次
package ch1.inputstream; import java.io.*; public class data { public static void main(String args[]){ try{ FileInputStream fin=new FileInputStream("D:\\javadaima\\src\\ch1\\inputstream\\a.txt"); }catch(FileNotFoundException ex){ex.printStackTrace();} try{ byte b=(byte)fin.read(); }catch(IOException ex){ex.printStackTrace();} System.out.println(b); } }
package ch1.inputstream; import java.io.*; public class data { public static void main(String args[]){ FileInputStream fin= null ; byte b = 0 ; try{ fin=new FileInputStream("D:\\javadaima\\src\\ch1\\inputstream\\a.txt"); }catch(FileNotFoundException ex){ex.printStackTrace();} try{ b=(byte)fin.read(); }catch(IOException ex){ex.printStackTrace();} System.out.println(b); } }