Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

array to arraylist

 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Report post to moderator
is there easy way to convert array to arraylist without using for loop?

I need to insert tehe object into array when a object is not in existing array. The existing code is set with array in a lot of places and I don't want to add for loop in everyplace.

Thanks,

Steve
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Report post to moderator
Steve,

Why not look here?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Indeed. Please stop posting duplicate copies of this question -- I already deleted one in this forum, and now I see you've reposted it. Please post just one copy of a question -- doing otherwise just waste's people time and makes them not want to help you in the future.

I'm closing this duplicate.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic