java - Spreading array of objects to the list of arguments -


i want spread array of objects this:

int size  = 3;   /* sample size */ object[] arrayofobjects = new object[size]; /* initialize array objects */ 

and using magical method, on output:

object obj1, object obj2, object obj3 

i need kind of output, because need use method allows list of arguments.

ps. api provides addall method, type of argument is: iterable <some_type> don't understand.

addall method "iterates" on collection , adds elements datastructure.

iterable, iterable, creates datastructure called iterator allows iterate on datastructure yourself.

object[] arrayofobjects = new object[size]; collection<object> mynewcollection = new arraylist<object>(); // use addall mynewcollection.addall(arrayofobjects);  // use iterator iterator<object> iter = mynewcollection.iterator(); while(iter.hasnext()){     object object = iter.next();     // object } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -