• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

main method

 
keith edward
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--I don't understand, if I run the program with no arguments, I get an exception that is below:
Don't understand. Thanks for any help.
'Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at moveopreports.FTPit.main(FTPit.java:42)'


[ January 07, 2003: Message edited by: Thomas Paul ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which is line 42?
 
keith edward
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the line with if (args.length > 1)
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in the code that will cause that exception. Which line is line 42? Can we see the rest of the code (please use the code tags!!!)?
 
keith edward
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, you are right, the code is alright. I don't understand why I got an error earlier.
Keith
 
keith edward
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by code tags?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code tags....
place [ code ] and [/code] around your program and it will format it in a way that retains your whitespace.

[code]
public class MyClass {
public class main(String args[]) {
System.out.println("Test");
}
}
[/code]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic