This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the input file?

 
petr pavlovich
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we consider an array arr[] of input file in my program?
Or I should somehow to another enter a array?

input file:
"ddd"
"sss"
" aaa"
"ggg"
" aaa "
"bbb"
"ddd", "ccc
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Petr,
Kindly explain your question more clearly
can we consider an array arr[] of input file in my program? Or I should somehow to another enter a array?

You mean to say the input array will reside in a file and read the File? Or you want a user to enter your array? What code modification you need to do?
 
petr pavlovich
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ox.
sorry.
my bad English. (google translator)


I do not understand the meaning of these words:
The name of the input and the path to the output files specified(it is set/given) in the form of two command line parameters.
.............................................................................................................. (in the form of two parameters command line)
indicate that these words?

each input file has a name?
that the two options(parameters)?
in my case is whether the array input file?(my array - the input file?)
 
Greg Brannon
Bartender
Posts: 563
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll take a shot at explaining the words you highlighted:

The name of the input and the path to the output files specified(it is set/given) in the form of two command line parameters.


This means that when the Java program is run from the command line, 2 command line parameters are specified, the name of the input file and the path and name of the output file. For example:

C> java myProgram NameOfInputFile c:/path/NameOfOutputFile

The words you posted leave some room for interpretation, but that's the best I can do.
 
petr pavlovich
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Greg Brannon


C> java myProgram NameOfInputFile c:/path/NameOfOutputFile

.


how to connect it with my program?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The args argument that the main method gets contains the command line parameters. For example:


C:\Temp>java Example hello petr
args[0] = hello
args[1] = petr

 
petr pavlovich
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as I enter the array app from an input file using BufferedReader?
that the program to use an array app instead arr.
The name of the input and the path to the output files specified(it is set/given) in the form of two command line parameters.


I so have understood my problem.=)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic