Re: Question: How do I read info into a java application from a file (txt) and through regular args
"shalom cohen" <firstname.lastname@example.org> wrote:
>I am new to java and have a question.
>Question: How do I read info into a java application from a
> file (txt) and through regular args in javac line?
Pass the file name as a command line argument. Use the BufferedReader class
to read the text file in your program:
FileInputStream istream = new FileInputStream(args);
BufferedReader reader = new BufferedReader(istream);
while((line = reader.readLine()) != null)
// whatever you want to do with the text
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center