I have a doubt with this value assignment in java.
When I put this:
double[] sumMatematicas ={50};
int suma = 0;
suma += sumMatematicas[0]);
It doesn't throw a "cannot implicitly convert a double to an int " exception and returns 50 .
But if I write the assignment like this:
double[] sumMatematicas ={50};
int suma = 0;
suma =suma + sumMatematicas[0];
It throws me the "cannot implicitly convert a double to an int " exception.
Why does it work with +=
?