GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes convert int to a string of 1's and 0's ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "convert int to a string of 1 Watch "convert int to a string of 1 New topic
Author

convert int to a string of 1's and 0's ???

Kevin Schneider
Greenhorn

Joined: Oct 16, 2003
Posts: 10
if i have an int=5, how do i get a string containing "101" representing the 5 in binary?
thanks
Kevin Schneider
Greenhorn

Joined: Oct 16, 2003
Posts: 10
i figured it out:
Integer.toBinaryString(5)
thanks anyways
 
GeeCON Prague 2014
 
subject: convert int to a string of 1's and 0's ???