String ss = stfDir.toString(); File readFile = new File( ss );
if( readFile.isFile() &&readFile.canWrite() && eadFile.canRead()) { RandomAccessFile rafFile = new RandomAccessFile(readFile,"rw"); while(rafFile.getFilePointer()<rafFile.length()) System.out.println(rafFile.readLine()); rafFile.close(); } else System.out.println("File cannot be read!"); } } </pre> run input d:\temp\test.java(the file exists),the result is: File cannot be read! but this file compile and run in JBuilder,the result is OK. and I use the sentence which is commented,the result is right not only in JBuilder but JDK self.
another is the sentense list underside in java is not be allowed?? while(char ch = (char)System.in.read())!='\n')