• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How do you remove a String [ ] from an ArrayList?  RSS feed

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an arraylist of String [] , and I need to be able get one at a specific location.

How do I return a complete String [] array from an arraylist?

Here is my code in 2 parts

// String array insertion code into array


And now in another method I am trying to retrieve that String [] from the ArrayList. Can anyone tell me how to do this, or if not, another possible workaround?

Thanks in advance!

 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to cast the return value of the get method to String[].
 
Sean Gildea
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked, thanks!

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!