What is the result of the following code compilation and execution?

public class Test1 {
    public static void main(String[] args) {
        int i = 1;
        i <<= 1;
        float f = 1;
        f = f << 1;
        System.out.println( i + ", " + f);
    }
}

bad operand types for binary operator '<<' first type: float second type: int

2016 Mar 19, 6:43:33 PM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes