This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes List to String error got running on Eclipse(Java perspective) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "List to String error got running on Eclipse(Java perspective) " Watch "List to String error got running on Eclipse(Java perspective) " New topic
Author

List to String error got running on Eclipse(Java perspective)

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
running on Eclipse(Java perspective) got:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at ListToString.main(ListToString.java:32)


Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3742
    
  16
On line 5 you declare stg1 as a zero length array.
On line 22 you try and put something into the first element of that array.


Joanne
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
you MEAN USE

String[list.size()] stg1;
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
String[] stg1=new String[list.size()];

success, thks
 
Have you checked out Aspose?
 
subject: List to String error got running on Eclipse(Java perspective)
 
It's not a secret anymore!