Markos Charatzas said:
Hello there,
Is there a way to create a Hashtable with some initial values?
in a same way as an array?
E.g.
String[] strings = {"2", "2","2"};
Thanx
I have been dealing with really shitty code lately, so I thought I'd comment
on some of the code that I have seen posted on this thread, in the false
hope that it will make my job easier.
Hashtable ht = new Hashtable(); // eek!!
Map m = new Hashtable(); // much nicer
// choke, choke, spew, spew !
class X extends Hashtable
{
}
// *at least* use a Decorator
class X implements Map
{
private Map m = new Hashtable();
}
Why are you using Hashtable anyway ? Supporting < 1.2 VMs ?
Do you require thread safety ? Why haven't you chosen to use a HashMap ?
</two-cents-worth>
--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
Home : +61 7 5502 7987
Work : +61 7 5552 4076
Mobile : 0408 711 099
(2003 VTR1000F)