import java.io.FileInputStream; import - TopicsExpress



          

import java.io.FileInputStream; import java.io.IOException; public class ByteReader{ public static void main(String[] ags){ try{ FileInputStream file=new FileInputStream(class.dat); boolean eof=false; int count=0; while(!eof){ int input =file.read(); System.out.print(input ); if(input==-1) eof=true; else count; } file.close(); System.out.println (\lnByte read: count); }catch(IOException e){ System.out.println(Error- e.toString()); } } } Upon running the java code above outputs/display: Error-java.io.FileNotFoundException: class.dat(The system cannot find the file specified). Debug the code.
Posted on: Mon, 07 Jul 2014 12:53:19 +0000

Trending Topics




© 2015