permaculture playing cards*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 3432
    
  12
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
 
Don't get me started about those stupid light bulbs.
 
subject: List to String error got running on Eclipse(Java perspective)
 
Similar Threads
sublist of arraylist???
getting the value of string array out of object array
add(index,object) and reverseOrder()
custom taglib problem
how to link parent[first list.xml] to second child[second list_item.xml]