Which line/lines will compilation error occur in?

public class Test {
    public static void main(String[] args) {
        char c = (char) 1; // 1
        boolean boo = (boolean) 1; // 2
        byte b = (byte) true;    // 3
1 initially is of type int that can be cast to char
int cannot be cast to boolean
boolean cannot be cast to byte

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes