Results 1 to 4 of 4
Thread: command line args
- 08-03-2008, 09:04 AM #1
Member
- Join Date
- Jun 2008
- Location
- us
- Posts
- 47
- Rep Power
- 0
command line args
hi friends
actually i want to run simple prg on Netbeans like
class A
{
public static void main(String args[])
{
System.out.print(args[0])
}
}
if i run this it will shows the Error for ArrayoutofBondException()
so plz help me in that or how i can run this ?Last edited by MarkWilson; 08-03-2008 at 09:08 AM.
- 08-03-2008, 09:21 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Right click on the Project. Go to the properties. You can have project properties window. Click on the run menu. There you can find a text field to add Arguments. Add what you want there. Compile and run the file.
- 08-03-2008, 02:09 PM #3
Your program needs to test if there are any args(args.length > 0) passed to it before using the first arg: args[0]
- 08-04-2008, 03:22 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
It should be, but I think our friend worried about that how to set command line arguments in NetBeans.
Similar Threads
-
Command line argument
By denisatandi in forum New To JavaReplies: 8Last Post: 10-16-2012, 11:37 PM -
[SOLVED] Compile from the command line
By GilaMonster in forum New To JavaReplies: 8Last Post: 06-13-2008, 07:12 AM -
Java command line
By agouzoul in forum New To JavaReplies: 2Last Post: 04-02-2008, 12:12 PM -
Exporting from the command line
By o1121 in forum EclipseReplies: 1Last Post: 08-09-2007, 07:29 PM -
Unable to execute command line command in java
By LordSM in forum New To JavaReplies: 1Last Post: 08-08-2007, 12:23 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks