Bit-wise Operator

Lesson Progress
0% Complete

Example Code

public class bitwiseOperator {
	public static void main(String[] args) {
		// BITWISE OPERATOR &,|
		int a = 25;
		// 11001
		int b = 15;
		// 01111
		int c = a | b;
		// 11001
		// 01111
		// 11111
		System.out.println(c);
		// binary shift
		int s = 8; // 1000.00
		int y = s << 2;// 100000.
	}
}