aspose file tools*
The moose likes Beginning Java and the fly likes main method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "main method" Watch "main method" New topic
Author

main method

keith edward
Greenhorn

Joined: Jan 07, 2003
Posts: 4
--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

Joined: Jul 11, 2001
Posts: 14112
Which is line 42?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
keith edward
Greenhorn

Joined: Jan 07, 2003
Posts: 4
the line with if (args.length > 1)
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
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!!!)?


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
keith edward
Greenhorn

Joined: Jan 07, 2003
Posts: 4
Thanks, you are right, the code is alright. I don't understand why I got an error earlier.
Keith
keith edward
Greenhorn

Joined: Jan 07, 2003
Posts: 4
what do you mean by code tags?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: main method