Originally posted by Dan Silva:
Can a byte or short be implicitly cast into a char? Thanks.
You do know that it is very simple to just try it out...
To answer your question, No. A byte or short can't be implicitedly casted to a char. The reverse is also disallowed. A char can't be implicitedly casted to a byte or a short.
It has to do with range. A byte or short has negative numbers which a char can't hold. And a char has values at its high range, which is out of range for a byte or short. This means that both directions needs to be casted explicitedly.
Henry