I have read about MAX_VALUE and found that a constant can hold a maximum value of 2^31-1. Where is the need to use a MAX_VALUE for any program?
I am also confused on this piece of stack code, where if the stack is empty it return Integer.Max_VALUE.
if(s2.isEmpty())
return Integer.MAX_VALUE;
Why should we return a max number when the stack is empty ?