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

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -