
Signature
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
>> class MCPStore {
>> HashMap<String, HashMap> categories = new HashMap<String,
[quoted text clipped - 5 lines]
> Perhaps you intended this to be in a function? It can't be by itself,
> in any case.
If this is to be done once when the object is constructed, you could put it
in the constructor (or, more risky, in the static initializer):
class MCPStore {
private final HashMap<String, HashMap> categories;
public MCPStore() {
categories = new HashMap<String, HashMap>();
HashMap<String, ArrayList> processes = new HashMap<String,ArrayList>();
categories.put("pname", processes);
}
}
- Oliver
Tor Iver Wilhelmsen - 04 Oct 2006 19:11 GMT
> If this is to be done once when the object is constructed, you could put it
> in the constructor (or, more risky, in the static initializer):
We,, they are instance fields so they would need to be in an instance
initializer. (Aka. code that gets put into every constructor.)
Oliver Wong - 04 Oct 2006 20:04 GMT
>> If this is to be done once when the object is constructed, you could put
>> it
>> in the constructor (or, more risky, in the static initializer):
>
> We,, they are instance fields so they would need to be in an instance
> initializer. (Aka. code that gets put into every constructor.)
You're correct, thanks.
- Oliver