komlaaa
asked on
Initialize a vector at declaration
I know for an Array u ca go: String myArray[] = {"a", "b", "c"}; ====> Initialization at declaration
How can i do a similar for a List? Exple: List myList = new ArrayList( ..... ) or i am not sure...?
How can i do a similar for a List? Exple: List myList = new ArrayList( ..... ) or i am not sure...?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
//Vector implements List
Vector v = new Vector(list);