Hi guys,
I am a C programmer trying to write in JAVA !!!! (so new to JAVA)
i have declared some public static int variables in my Main class which I want to use in another classes. In one class i have a switch statement
switch (tickerId){
case Main.ftse_contract_id: ftse_data.writeToFile(msg);break;
case Main.ftsefut_contract_id: ftsefut_data.writeToFile(msg);break;
case Main.indu_contract_id: indu_data.writeToFile(msg);break;
case Main.lloy_contract_id:: lloy_data.writeToFile(msg);break;
case Main.barc_contract_id: barc_data.writeToFile(msg);break;
case Main.vix_contract_id: vix_data.writeToFile(msg);break;
}
this is giving me the usual "constant expression required" error. The problem is with Main.xxx_contract_id ints that I declared before to be used everywhere. Can someone please tell me either a better way of having GLOBAL ints or how to make the CASE statements work.
Thank you