I\'d a code snippet:
class AutoTypeCast{ public static void main(String...args){ int x=10; byte b=20;//no compilation error byte c=x;
X defined as integer, while narrowing there may be data loss, that is why compiler error. Refer jvm spec for conversions & promotions