Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception errror in a program

 
aman goyal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time UseCodeTags. I have added them for you.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic