Posted By:
simran_r
Posted On:
Tuesday, February 17, 2009 03:28 AM
import java.io.*; import java.util.*; class C2 { public static void main(String args[])throws Exception{ int size; try{ //File f0=new File("sample.txt"); InputStream f1=new FileInputStream("C:/Documents and Settings/All Users/Desktop/java/prg1/src/sample.txt"); } catch(FileNotFoundException e){ System.out.println("File not found"+e); } size=f1.available(); System.out.println("Total available bytes:"+size); System.out.println("First 1/4 of the file:"); for(int i=0;i System.out.print((char)f1.read()); } } } these are the errors v r getting
More>>
import java.io.*;
import java.util.*;
class C2 {
public static void main(String args[])throws Exception{
int size;
try{
//File f0=new File("sample.txt");
InputStream f1=new FileInputStream("C:/Documents and Settings/All Users/Desktop/java/prg1/src/sample.txt");
}
catch(FileNotFoundException e){
System.out.println("File not found"+e);
}
size=f1.available();
System.out.println("Total available bytes:"+size);
System.out.println("First 1/4 of the file:");
for(int i=0;i
System.out.print((char)f1.read());
}
}
}
these are the errors v r getting
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
f1 cannot be resolved
f1 cannot be resolved
at C2.main(C2.java:13)
we are not able to execute this..
<<Less