This code is from K&B pg 440... i have understood the program but i have not understood the output given in the program...
code:
Assume that we already have a subdirectory called existingDir in which resides an existing file existingDirFile.txt, which contains several lines of text. When you run the following code,
File existingDir = new File("existingDir"); // assign a dir
System.out.println(existingDir.isDirectory());
File existingDirFile = new File(
existingDir, "existingDirFile.txt"); // assign a file
System.out.println (existingDirFile.isFile());
FileReader fr = new FileReader(existingDirFile};
BufferedReader br = new BufferedReader(fr); // make a Reader
String s;
while( (s = br.readLine()) != null) // read data
System.out.printIn(s);
br.close();
the following output will be generated:
true
true
existing sub-dir data
line 2 of text
line 3 of text
// here there is no print command for "existing sub-dir data"... then what is it... is it an explanation??? i just want to confirm....
thanks....