This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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: 127
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: 127
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: 14190

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
Don't get me started about those stupid light bulbs.
subject: specifiy a file local in code