public class BitShifting {
public static void main(String[] args) {
final int i = 2, j = 2, k = i << j;
System.out.println(i + " << " + j + " == " + k + " (dezimal)");
System.out.println(Integer.toBinaryString(i) + " << " + j + " == " + Integer.toBinaryString(k) + " (binär)");
}
}
y << x = y * (2^x)
oder mathematisch gesehen
Code:y << x = y * (2^x)