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() {
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
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.