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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -