java - Get current case number -
java - Get current case number -
i have simple switch case statement, , want current case int.
for example:
case 5: // code break; i want 5.
ideas?
usually within switch case need meet condition. can print status variable within switch case.
int conditionvariable = 0; at point in execution conditionvariable set value in program. switch case execute, compare conditionvariable cases.
switch (conditionvariable) { case 5: // prints case number logcat. log.d("tag", conditionvariable); break; . . . } java switch-statement
Comments
Post a Comment