Hello,
I need explanation equality between integers in the last exercice. while the integer is less than 127, the equality works but beyond it's not. I have to cast integer into int. I believe the conversion is automatically done by the compiler.
if (i + 1 < list.size() && (int)list.get(i) == (int)list.get(i + 1)){
j++;
}
the code below doesn't work without the cast. why???
Thanks in advance.
This website uses cookies to provide you with personalized service. By using this website, you agree to our use of cookies. If you require more details, please read our Terms and Policy.
GO TO FULL VERSION