Hi Mario,
This is really a context sensitive question: neither is ever 'better': it's all a matter of context.
Regarding the Data class. It seems to me that you have two options, since the documentation I had implied that you only had two choices, extending the class, or modifying it.
1. Modify Data. This has the advantage of reducing the number of necessary classes, thus reducing the complexity of the code base. OTOH, it takes away generic nature of the class.
2. extend the class. Allows specialization, but at the cost of introducing a potentially superfluous class, which is not actually used for anything.
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
[ March 08, 2003: Message edited by: Max Habibi ]