i have:
if (Constants.IS_LIVE_MOD == false)
account = Constants.OM_ACCOUNT;
else
account = "abc";
i am getting a dead code warning on ‘else’. Why is it so and wat is the solution for it. Please help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume the
IS_LIVE_MODconstant is a final variable that is declared as false, if so then the variable is always false and can’t be changed, and so the else statement will never be invoked. Therefore it is dead code.E.g.