How to assaign binary numbers to an int variable
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abdul_Sattar
Posted On:   Tuesday, February 1, 2005 01:46 AM


How to assaign binary number to an int variable in java ?


I know that for octal number the assignment is "int i=014"


for hexadecimal number the assignment is "int i=0x14"



But how to assaign binary number to an int variable ?

Re: How to assaign binary numbers to an int variable

Posted By:   ankush_purwar  
Posted On:   Tuesday, February 1, 2005 06:55 AM

Suppose that you have binary number
String str = "1000000101000001"
int i = Integer.parseInt(str,2);
About | Sitemap | Contact