Skip to content

Instantly share code, notes, and snippets.

@codingminecraft
Created July 7, 2021 17:14
Show Gist options
  • Save codingminecraft/b95bdadc1e9bb42c30355d869695dd5f to your computer and use it in GitHub Desktop.
Save codingminecraft/b95bdadc1e9bb42c30355d869695dd5f to your computer and use it in GitHub Desktop.
Bitwise Operators
class Main {
static int[] someArray = {0, 1, 2, 3, 4};
public static void main(String args[]) {
System.out.println("SomeArray[0]: " + someArray[0]);
System.out.println("SomeArray[1]: " + someArray[1]);
System.out.println("SomeArray[2]: " + someArray[2]);
System.out.println("SomeArray[3]: " + someArray[3]);
System.out.println("SomeArray[4]: " + someArray[4]);
System.out.println();
System.out.println("'0 | 1 | 2': " + (0 | 1 | 2));
System.out.println("SomeArray[0 | 1 | 2]: " + someArray[0 | 1 | 2]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment