Arun Vasu wrote:I need to avoid looping, so any solutions without using loops ?
That's not really how this works. What did you try? Where are you stuck? What worked? What didn't work? How didn't it work? Be specific and post code that demonstrates what you've tried.
Show some effort.
No. Turning a String into an ArrayList<String> - not a problem. Turning an ArrayList<String> into a String - not a problem. But because you need to convert each String into a Long you have no other option than to use a loop.
Actually, all solutions include a loop. The loop may be hidden for you (e.g. the ArrayList(Collection) constructor, List.toArray(...)) but it's still there.