954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

list inside vector

Hello

I'd like to have a list of ints inside my vector..

I tried to do the following:

private static Vector<List<int>> getCombMatrix() {


But it will give me error: Syntax error on token "int", Dimensions expected after this token

However, this works okay:

private static Vector<int[]> getCombMatrix() {


What am I doing wrong?

Thanks for help

l2u
Newbie Poster
9 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

you can't use primitives as elements in a Collection.
Nor can you use arrays.

So you use Integer instead of int.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Thanks a lot!

l2u
Newbie Poster
9 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 
Nor can you use arrays.


no

bugmenot
Posting Whiz in Training
225 posts since Nov 2006
Reputation Points: 53
Solved Threads: 34
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You