-
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 ?
-
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.
-
Your program needs to test if there are any args(args.length > 0) passed to it before using the first arg: args[0]
-
It should be, but I think our friend worried about that how to set command line arguments in NetBeans.