what is vectors in Java. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is vectors in Java.

13th Jul 2016, 5:09 PM
Aayush. Aggarwal
Aayush. Aggarwal - avatar
3 Answers
+ 1
its an array of data type, imagine it like a row of elements of the same data, for example, a row of integer.
13th Jul 2016, 6:06 PM
Hoover A. Serna
Hoover A. Serna - avatar
+ 1
then what is the difference between an array and vectors or key advantage of vectors over array.
13th Jul 2016, 6:20 PM
Aayush. Aggarwal
Aayush. Aggarwal - avatar
+ 1
well, an array have a fix size, but a vector is dynamic, this means, that the vector size changes, when you add more elements, also the vector provides methods to work with the elements of it, when you see classes and interfaces, you will understand better, how to work with methods. regards.
13th Jul 2016, 7:21 PM
Hoover A. Serna
Hoover A. Serna - avatar