Java binary literal usage -


all examples on binary literal like: int a=0b1011 question is, can translate existing variables form? example, fromint b=10000011; want int c=0b10000011.

you use integer.parseint(string, int) , like,

int b = 10000011; int c = integer.parseint(string.valueof(b), 2); int d = 0b10000011; system.out.println(c == d); 

and true.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -