Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java integer to binary string

int n = 1000;
String s = Integer.toBinaryString(n);
Comment

java int to binary

public static String makeBinaryString(int n) {
	StringBuilder sb = new StringBuilder();
	while (n > 0) {
    sb.append(n % 2);
		n /= 2;
	}
  	sb.reverse();  	
  	return sb.toString();
}
Comment

int to binary java

String binary = Integer.toBinaryString(num);
Comment

integer to binary java

Integer.toString(100,8) // prints 144 --octal representation

Integer.toString(100,2) // prints 1100100 --binary representation

Integer.toString(100,16) //prints 64 --Hex representation
Comment

PREVIOUS NEXT
Code Example
Java :: what is super in java 
Java :: java close tcp socket output stream but not socket 
Java :: fabricmc spawn item 
Java :: get block player is looking at bukkit 
Java :: how to read from a txt file in java 
Java :: apache dependency 
Java :: android onlcik java 
Java :: input string a list in java 
Java :: how to read a .json from web api java 
Java :: how to set 2 decimal places in java 
Java :: java split string on two or more spaces except for words in quotes 
Java :: display image from database in java servlet 
Java :: load a file from classpath spring boot 
Java :: org.mockito.exceptions.misusing.WrongTypeOfReturnValue 
Java :: how to reverse a list in java 
Java :: java code examples 
Java :: java current time millis 
Java :: java int to int array 
Java :: simple date format 
Java :: how to initialize an array in java 
Java :: android hide status bar and action bar daynamically 
Java :: change drawable color programmatically android 
Java :: spigot respawn player location 
Java :: java how to make a gui 
Java :: link to method javadoc 
Java :: {} when initialising arraylist java 
Java :: how to scan a string in java 
Java :: Java Hashmap Access Elements 
Java :: java expressions 
Java :: java xmx example 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =