-
Converting Decimal to Binary in Java
The below code will convert decimal number in binary format [bits] in java. I have taken a byte as an array, i.e. 8. You can take more depending on your needs. The input for the current program is a with the value 48. You can take the input through scanner too. Code: public class bitbyte…