I would like to convert a decimal number into a binary number and return that binary number. However, I need to be able to represent this binary number as one whole int
variable. The examples and past questions I've seen only returns 0's and 1's separately, which won't work.
Right now, the way I'm doing it I'm storing the 0's and 1's in an int
array. Is there any way to get all these array elements and form one int
variable? Or is there another, better way? I'm trying to make as few java library calls as possible (ie few parseInt(), etc.)