Question: Given this enumeration, how would you access the integer-type value of 'AppState.Loading'?

  1. string currentState = (string)AppState.Loading;
  2. string currentState = AppState.Loading.integralVal;
  3. int currentState = AppState.Loading.rawValue;
  4. int currentState = (int)AppState.Loading;

Answer: The correct answer of the above question is Option D:int currentState = (int)AppState.Loading;