How can I find an object in Vector that contains the biggest number of elements?
For instance:
int[] val1 = {1,2,3};
int[] val2 = {1};
int[] val3 = {1,2};
Vector<Object> d = new Vector<Object>(); // update
c.add(val1);
c.add(val2);
c.add(val3);
int answ = findBiggest(c);
In this example, answ should be equal to 0, because val1 contains 3 numbers.
I have answered this by taking the liberty of changing the datatype to arraylist, which I believe is what you originally wanted..
I also changed the generic type to Integer[] too. Because I believe there is an overhead associated with autoboxing, which I guess is minimal but good practice? (Can anyone confirm this?)