Hi; I've run your program on my own computer and got no errors. I've called the program in this format; not from netbeans; but just right from the shell
$ java Maxof2 15 16 16 is greater than 15 nothing special happened. By the way I think you do something with Netbeans to call that program with appropriate arguments as it is running it. I think we name it Run Configuration or something like that; I've no access to netbeans by this time, to check it. With the hope of rising of Mahdi; Ali Shakiba Shahid Bahonar University of Kerman Iran - Kerman On Tue, Jan 19, 2010 at 9:39 AM, musmir iqbal <[email protected]> wrote: > when i run this code using NetBeans 6.5.1 i get an error > > > class Maxof2{ > > public static void main(String args[]){ > > //taking value as command line argument. > > //Converting String format to Integer value > > int i = Integer.parseInt(args[0]); > > int j = Integer.parseInt(args[1]); > > if(i > j) > > System.out.println(i+" is greater than "+j); > > else > > System.out.println(j+" is greater than "+i); > > } > > } > > > this is the error message > Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 > at MaxOf2.main(MaxOf2.java:9) > Java Result: 1 > > -- > Musmir Iqbal > > -- > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected]<javaprogrammingwithpassion%[email protected]> > For more options, visit this group at > http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
