Content received from: http://JavaFAQ.nu/java-article40.html


Question: Can anyone tell me why the Java Vector class is called a ''Vector''?
Monday, January 27, 2003 (01:00:00)

Posted by jalex

Question: Can anyone tell me why the Java Vector class is called a "Vector"?
I come from the engineering world, so I am trying to make some sense out of the name.

Answer: "Vector" is a common name for an array of one dimension. I think that it was designed to be accessed in only one direction - from start to end. Of course, you can write code to iterate backwards...


But the enumeration it goes you don't have a getPrev() method, only a getNext():

for (Enumeration e = v.elements() ; e.hasMoreElements() Wink {
System.out.println(e.nextElement());
}

So a Vector has dimension (number of elements) and direction (in terms of access). Are you agree?
******************************************************************
Our older tips: March 22, 2001 - Oktober 21, 2002 read here.
All published and not published on site tips you can find here