Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

plz delete

 
C Ho
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
plz delete
[ December 04, 2004: Message edited by: C Ho ]
 
Barry Higgins
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thing you'll need to do is to read in your text file and capture the data in a String .. I assume that each Shape will at least be on a different line in the text file.
Then you'll need to parse the String using the split command this will give you a sinle dimension array for each String. If you can get that far you'll be 90% of the way there.
Have a go at reading in the file first and if you are having problems post back.
Good luck,
Barry
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far? You probably need to use FileInputStream, FileReader, or some other classes from the java.io package. That's where I suggest you start.

Keep Coding!

Layne
 
C Ho
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"First thing you'll need to do is to read in your text file and capture the data in a String .. I assume that each Shape will at least be on a different line in the text file.
Then you'll need to parse the String using the split command this will give you a sinle dimension array for each String."

Are there any examples? I find that I learn best with example, else I just sit on a chair coding for hours, days, weeks without progress because I simply do not know what Im doing!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a textbook? It should have plenty of examples. You may also want to see if the Java Tutorial has something appropriate to help you. Also, the links to the Java API documentation I gave above have a lot of helpful information, even if there are not full code examples.

Layne
 
C Ho
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No textbook, school is really crappy..
 
C Ho
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is what i have so far:



I keep getting this error though, can someone please help me?

Error: cannot resolve symbol
symbol : class IOException
location: class ReadFileToArray
 
C Ho
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be as simple as adding an import at the top of the class ... right after package if you have one, right before class.

import java.io.IOException;
 
C Ho
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
, now i can finally see how this makes sense
[ December 04, 2004: Message edited by: C Ho ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic