Đ Đức Linh New member Sep 19, 2021 #1 What will be the output of the following Java program? Code: class bitwise_operator { public static void main(String args[]) { int a = 3; int b = 6; int c = a | b; int d = a & b; System.out.println(c + " " + d); } } A. 7 2 B. 7 7 C. 7 5 D. 5 2
What will be the output of the following Java program? Code: class bitwise_operator { public static void main(String args[]) { int a = 3; int b = 6; int c = a | b; int d = a & b; System.out.println(c + " " + d); } } A. 7 2 B. 7 7 C. 7 5 D. 5 2
P Phác Chí Huấn New member Sep 19, 2021 #2 Answer: a Explanation: And operator produces 1 bit if both operand are 1. Or operator produces 1 bit if any bit of the two operands in 1. output: Code: $ javac bitwise_operator.java $ java bitwise_operator 7 2 Upvote 0 Downvote
Answer: a Explanation: And operator produces 1 bit if both operand are 1. Or operator produces 1 bit if any bit of the two operands in 1. output: Code: $ javac bitwise_operator.java $ java bitwise_operator 7 2