wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Displaying a text File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Displaying a text File " Watch "Displaying a text File " New topic
Author

Displaying a text File

Jdinesh Tiwari
Ranch Hand

Joined: Jan 13, 2013
Posts: 35
Hi, All

According to this code specified in book
I am unable to see my File
as per the command specified at command promt
please see the last line n the comment very first.

Though my file exists D:



fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11161
    
  16

seems to work for me.

Can you be more specific in what the problem is? Did you compile it? Did you run it? What were the exact commands you gave? Did it show an error? what is in the file you are trying to display?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jdinesh Tiwari
Ranch Hand

Joined: Jan 13, 2013
Posts: 35
Hi, fred
No, there is no problem neither in its compilation nor in execution

Actually i had a file in D: with name TEST.TXT and want to see that very file

and for file display i was trying this program, but i am unable to see my file (i want that it should get open)
Ishan Pandya
Ranch Hand

Joined: Feb 06, 2012
Posts: 219

Seems good to me also.. It is displaying in my machine also.
Is your java file and the .txt file in the same directory? if no the store them into the same directory any run the program.


OCPJP
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying a text File
 
Similar Threads
FileInputStream Initialization...
Query in code of displaying a text file
Explanation
Reading from a File, Need help
meaning of return; only