12345678910111213141516171819202122232425262728 |
-
-
-
- public class IntegerPrinter {
-
- public String printIntegerAsBinary(int value){
- String binary = Integer.toString(value,2);
- System.out.println(binary);
- return binary;
- }
-
- public String printIntegerAsOctal(int value){
- String octal = Integer.toString(value,8);
- System.out.println(octal);
- return octal;
- }
-
- public String printIntegerAsHexadecimal(int value){
- String hex = Integer.toString(value,16);
- System.out.println(hex);
- return hex;
- }
-
- public static void main(String[] args){
-
- }
- }
|