In Java 7:
int i = 0b10101010;
There are no binary literals in older versions of Java (see other answers for alternatives).
In Java 7:
int i = 0b10101010;
There are no binary literals in older versions of Java (see other answers for alternatives).