What will be printed to console after the following code is compiled and executed?

public class Main {
    public static void main(String s[]) {
        System.out.println(4|3);
    }
}
Explanation
| is a bitwise OR operator
4 OR 3 = 100 OR 011 = 111 = 7
Java
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback