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.

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.

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.

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 article has been dead for over six months. Start a new discussion instead.