Hello Ranchers,
the code,
the output is: case 1's i= 1
case 2's i= 2
case 3's i= 3
case 4's i= 4
case 5's i= 5
case default's i= -2147483647
Exception in
thread "main" java.lang.AssertionError: error Mr. Akshay Fix it!!!
at scjp.Code.TechnoSample.main(A.java:16)
Well i can figure out till "case 5" but then why Integer.MIN_VALUE
appears at default case together with AssertionError.
It this something to do with infinite for loop???I can't figure out.
According to my understanding ,when the application prints the value of i as 5, the control goes out of switch statement and passes to boolean expression of while loop where the expressionis true and value of i is now 6.then it should execute default statement and should print
case default's i=6 toghter with AssertionError.
Plz correct me if i'm wrong.
Regards ,
Akshay