File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes specifiy a file local in code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "specifiy a file local in code" Watch "specifiy a file local in code" New topic

specifiy a file local in code

jite eghagha
Ranch Hand

Joined: Oct 06, 2006
Posts: 128
If i had this file structure:

David McCombs
Ranch Hand

Joined: Oct 17, 2006
Posts: 212
I am not sure what you mean.

Do you mean Plants is a file in the same folder as cat.class, and cat needs to open Plants? Or something else?

If it is the former, you don't need include a file path in the IO class you are using to open it. ie FileReader fr = new FileReader("Plants");

If it is the latter, please post a bit more detail.

"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle
jite eghagha
Ranch Hand

Joined: Oct 06, 2006
Posts: 128
sorry about that,


what string points to the bat.txt; i think it looks something like this. (because they're in the same folder)

[ June 15, 2007: Message edited by: jite eghagha ]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

It's not very clear what you are asking. Can you please explain in more detail what you want to know exactly?

Why not just do this:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: specifiy a file local in code
It's not a secret anymore!