Results 1 to 8 of 8
- 11-21-2010, 09:28 AM #1
Member
- Join Date
- Nov 2010
- Location
- Beirut, Lebanon
- Posts
- 36
- Rep Power
- 0
- 11-21-2010, 10:29 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
All the command line parameters passes in a string array.
Java Code:public static void main(String[] args)
- 11-21-2010, 10:30 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
In most of the reading materials of Java explains this as the first step. Did you ever notice that?
- 11-21-2010, 01:50 PM #4
Member
- Join Date
- Nov 2010
- Location
- Beirut, Lebanon
- Posts
- 36
- Rep Power
- 0
this is not what i meant
after the public static void main(String args[])
{
int num = Integer.parseInt(args[0]);
}
this i use to enter integers from the command what do i use to enter a word from the command line(integer). thanks in advance for your help
- 11-21-2010, 02:04 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Last edited by JosAH; 11-21-2010 at 02:05 PM. Reason: I can't count ...
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-21-2010, 03:20 PM #6
Member
- Join Date
- Nov 2010
- Location
- Beirut, Lebanon
- Posts
- 36
- Rep Power
- 0
never mind i found the answer i wanted thanks anyways. i just had to enter args[0] where i wanted the input to appear i didnt need parsing after all.
- 11-21-2010, 03:35 PM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Me too Jos, OPs question is not clear enough. Did he mean to passing command line arguments or passing values (reading form the console) from the command line. Anyway seem OP solved the problem.
- 11-21-2010, 03:36 PM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
command line arguments
By evermore in forum New To JavaReplies: 5Last Post: 03-28-2010, 05:08 AM -
java command line arguments
By Vipul03 in forum Advanced JavaReplies: 10Last Post: 02-25-2010, 10:12 AM -
java command line arguments
By Vipul03 in forum New To JavaReplies: 1Last Post: 02-22-2010, 02:00 PM -
arguments in command-line
By girlet18 in forum New To JavaReplies: 2Last Post: 01-21-2010, 02:05 PM -
Java Command Line Arguments In Eclipse IDE
By JavaForums in forum EclipseReplies: 0Last Post: 05-19-2007, 09:45 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks