implicit « cast « Java Data Type Q&A





1. implicit casting    coderanch.com

Normally, integer literals are always interpreted as int - the reason that it works in a line where you declare and initialize a byte is because that statement is treated as a special case by the Java compiler. The reason why Java does not allow this with a method that takes a byte is because it can lead to confusing situations. ...