java - How to write something in binary and assign it to a variable? -


possible duplicate:
in java, can define integer constant in binary format?

in python, can like:

a = 0b00000010 set 2.

is possible in java? know go through , assign varibles number instead of binary, visual.

thanks ~aedon

in java 7, can do

int = 0b00000010; 

however if you're working older version, i'm afraid you're stuck with

int = integer.parseint("00000010", 2); 

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -