I think this is a suboptimal solution, but you could do
String.format("%16s", Integer.toBinaryString(1)).replace(' ', '0')
More Related Contents:
- How to determine if a number is binary and has an even amount of zeros with only one regex?
- Printing Binary values using nested loops [closed]
- The main thing is: how that binary for example 11110000 is divided into two parts such as s1=1111 and s2=0000. I have to do this in Java
- how to get the first two bytes from a string in java?
- How to format strings in Java
- Output in a table format in Java’s System.out
- Java: Syntax and meaning behind “[B@1ef9157”? Binary/Address?
- How are integers internally represented at a bit level in Java?
- Should I use Java’s String.format() if performance is important?
- Convert A String (like testing123) To Binary In Java [closed]
- Named placeholders in string formatting
- How do you embed binary data in XML?
- Converting an int to a binary string representation in Java?
- Converting Decimal to Binary Java
- How to convert a byte to its binary string representation
- In Java, can I define an integer constant in binary format?
- Convert binary string to byte array
- Convert Java Date to UTC String
- How to center a string using String.format?
- Compare two Byte Arrays? (Java)
- Convert hexadecimal string (hex) to a binary string
- Are there binary literals in Java?
- How to convert a Binary String to a base 10 integer in Java
- Convert Double to Binary representation?
- Adding binary numbers
- Right padding with zeros in Java
- Determining binary/text file type in Java?
- Format floating point number with leading zeros [duplicate]
- Java parsing XML document gives “Content not allowed in prolog.” error [duplicate]
- Is Dalvik’s memory model the same as Java’s?