java - how to initialize hashmap on class level without using static block -


i want initialize 1 hashmap, don't want use constructor way, neither want initialize in static block. can please tell me how that?

public classname() {     idtoskillres = new hashmap(); } 

i don't want use in these way

you can declare instance member on top , initialise right away.

map<type,type> idtoskillres = new hashmap<type,type>();  public classname() {  } 

that not constructor, neither static block.


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -