0

Ok,

I've been looking through some of the older threads and noticed some bad things regarding vectors.

So what's the deal. Are they worth using in java or should I avoid them like the plague? And if I should, what should I be using instead?

The same questions applies to the StringTokeniser container.

ThanQ.

4
Contributors
8
Replies
9
Views
11 Years
Discussion Span
Last Post by aniseed
0

Vectors shouldn't be used, because ArrayLists are simply better ;)

StringTokenizer isn't that bad, but I think the newer version is called StringBuilder... I could be wrong about that one.

0

Vector is an old legacy class that's been replaced by far more efficient mechanisms.
Its main problem is its poor performance, using ArrayList can under circumstances give you an order of magnitude higher speed.

StringTokenizer is similar. Use the split() method (for example, there are other mechanisms depending on what you are trying to achieve, like indexOf() and substring()) on String instead.

0

StringTokenizer isn't that bad, but I think the newer version is called StringBuilder... I could be wrong about that one.

StringTokenizer has a better version in String.split()
StringBuilder is an enhanced StringBuffer. :-|

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.