12345678910111213141516171819202122232425262728 |
- import java.util.*;
-
- public class IntegerPrinter {
-
- public String printIntegerAsBinary(int value){
- String binary = Integer.toBinaryString(value);
-
- //Integer i = new Integer(20);
- //String binary = Integer.toBinaryString(i);
- //System.out.println("Binary value: "+binary);
- return binary;
- }
-
- public String printIntegerAsOctal(int value){
- String binary = Integer.toOctalString(value);
- return binary;
- }
-
- public String printIntegerAsHexadecimal(int value){
- String binary = Integer.toHexString(value);
- return binary;
- }
-
- public static void main(String[] args){
-
- }
- }
|