1234567891011121314151617181920212223242526 |
- /**
- * Write a program that reads an integer and prints it in
- * binary, octal, hexadecimal
- */
-
- public class IntegerPrinter {
- public String printIntegerAsBinary(int value){
- String binary = Integer.toBinaryString(value);
- return binary;
- }
-
- public String printIntegerAsOctal(int value){
- String octal = Integer.toOctalString(value);
- return octal;
- }
-
- public String printIntegerAsHexadecimal(int value){
- String hex = Integer.toHexString(value);
- return hex;
- }
-
- public static void main(String[] args){
-
- }
- }
|