constants - How to decrement the value of the declared variable in java after each execution -


public class test {     public static void main() {         = 5;         i--;         system.out.println("the value of is" + i);     } } 

in above program want value of constant i ,being reduced after every execution of program doesn't happen , can't happen. there way can reduce value of declared constant i?

you must store outside of java.

  1. in environment variable
  2. in file
  3. in database
  4. get initial value parameter , return i+1 exit code next execution

Comments