permaculture playing cards*
The moose likes Java in General and the fly likes Exception errror in a program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Exception errror in a program" Watch "Exception errror in a program" New topic
Author

Exception errror in a program

aman goyal
Greenhorn

Joined: Nov 29, 2009
Posts: 5
This is the program:-


I am getting this error:-
Caught exception java.lang.ArrayIndexOutOfBoundsException: 0
Please help me to rectify the error
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Next time UseCodeTags. I have added them for you.


[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I am getting this error:-
Caught exception java.lang.ArrayIndexOutOfBoundsException: 0


Posting the full stack trace would help a lot. It contains the exact line where the exception was raised.
Evan Caballero
Ranch Hand

Joined: Dec 10, 2009
Posts: 59
perhaps there is a mistakes here : fis = new FileInputStream(args[0]);

If you do not pass any arguments to your program, the args array will be of length 0, so there won't be any element à index 0.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Exception errror in a program
 
Similar Threads
Help with writing to a file!
Playing with KeyPair
Product ID
Algorithm DES not available