• Source
    1.  
    2. class Ideone
    3. {
    4. public static void main (String[] args) throws java.lang.Exception
    5. {
    6. //Error
    7. boolean x = true;
    8. int y = x;
    9.  
    10. //Error
    11. boolean x = true;
    12. int y = (int) x;
    13. }
    14. }