Question: Write a method in Java named decimalToBinary that takes an integer n between 0 and 255 (you can assume the method will always be called
Write a method in Java named decimalToBinary that takes an integer n between 0 and 255 (you can assume the method will always be called with a number between 0 and 255). The method converts that integer into a string containing an 8-bit binary representation of that number, i.e., a string with exactly 8 symbols (either 0 or 1). For example, decimalToBinary(23) returns the string "00010111".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
