//I have a silly question :)
//I understand this line:
targetChar = (char)sourceInt;
/*that targetChar wasn't declared
and has no value in it unless we
cast the sourceInt with a (char).
But what I do not understand is
that why do we not have to do
the same for the very next line:*/
targetChar = sourceDouble;
/*Why do we not have to add a cast
(char) with the sourceDouble?
And what is the difference between */
targetChar = sourceDouble;
//and,
targetChar = (char)sourceDouble;
/*They both give us 7 anyway,
but I do not understand why.*/
2 posts - 2 participants