Are there binary literals in Java? December 19, 2023 by Tarik In JDK 7 it is possible: int binaryInt = 0b101; Just prefix your number with 0b.