Link to home
Start Free TrialLog in
Avatar of komlaaa
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...?
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of expertmb
expertmb

>>Q:Initialize a vector at declaration
//Vector implements List
Vector v = new Vector(list);
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial