java integer to binary string
int n = 1000;
String s = Integer.toBinaryString(n);public static String makeBinaryString(int n) {
StringBuilder sb = new StringBuilder();
while (n > 0) {
sb.append(n % 2);
n /= 2;
}
sb.reverse();
return sb.toString();
}
Also in Java:
- imagesbutton how to set background
- java string format with placeholder
- Gson write json to file
- mutable string in java
- system.out.println shortcut
- how to play a clip of audio in java when needed
- even or odd in java
- java search file in folder
- has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 55.0
- read from elasticsearch in spark
- java recursion
- java create directory if not exists
- alfred workflow
- java xml element get attribute value
- java how to iterate through a arraylist
- java resultset to table
- in java how to convert string to integer
- replaceall in java
- linux pyspark select java version
- spigot get player from UUID
- java hashmap size
- 2d array java
- setbackground java
- sublist in java