Java – Why Is an Array Called a ‘Vector’?

java

I am reading a book on Java Programming, and want to confirm I understand the definition of the word "vector". Wikipedia says vector is "A one-dimensional array", source http://en.wikipedia.org/wiki/Vector.

Wouldnt it be simpler to call the array simply an array? Is there any reason we need to use such fancy language as "vector"? Is there a difference between an array and a vector?

enter image description here

Source: Cracking the Coding Interview, 4th Edition, by Gayle McDowell, page 47.

FAQ
Q – Why didnt you post this on english.stackexchange.com?
A – Because I think only computer science oriented people will have a good answer.

Best Answer

In typical usage, an "array" can mean either a single-dimensional array, or a multidimensional array. Also, in mathematics, a matrix is a 2-dimensional array while a vector is a 1-dimensional array.

Related Topic