Compatible & Incompatible types
967983Mar 26 2013 — edited Mar 27 2013Why is that I can assign a integer value to a double variable, but cannot assign a double value to an integer variable? Aren't double and integer compatible types? Isn't there a concept of truncation in java? I searched the net but in vain. I couldn't find the exact answer I was looking for. So I am posting in this forum.
PS: I understand it is not possible to assign an integer to a string since they are incompatible types.
Edited by: 964980 on Mar 26, 2013 9:29 PM