• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help needed with file reading in program.

 
Derek Grey
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am a beginner on posting messages and also on JAVA so please excuse the conventions.
I am having a problem reading a file ....
PROGRAM:
-------

ERROR:
------
mod.java:11: Class TextFileIn not found in type declaration.
TextFileIn f = new TextFileIn("bigfile.txt");
^
mod.java:11: Class TextFileIn not found in type declaration.
TextFileIn f = new TextFileIn("bigfile.txt");
Thanks You'all
[ February 14, 2002: Message edited by: Cindy Glass ]
 
Les Dsouza
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If TextFileIn is a class defined by you make sure it can be found in one of the folders in your classpath.
Also make sure your classpath includes "." (ie the current folder).
If textFileIn is not in a package, put it in th3e same folder as your main class and then compile.
If TextFileIn is in a package then you need to import it.
You can also check out the following code:
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool Looks like you are trying to use the TextFileIn class from the JavaRanch Common
If that is the case, you need to ensure you include common.jar in your classpath and then import com.javaranch.common.TextFileIn; at the top of your class and it should work.
[ February 14, 2002: Message edited by: Carl Trusiak ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic