IntegerPrinter.java 581B

1234567891011121314151617181920212223242526
  1. public class IntegerPrinter {
  2. public String printIntegerAsBinary(int value){
  3. System.out.println(Integer.toBinaryString(value));
  4. return Integer.toBinaryString(value);
  5. }
  6. public String printIntegerAsOctal(int value){
  7. System.out.println(Integer.toOctalString(value));
  8. return Integer.toOctalString(value);
  9. }
  10. public String printIntegerAsHexadecimal(int value){
  11. System.out.println(Integer.toHexString(value));
  12. return Integer.toHexString(value);
  13. }
  14. public static void main(String[] args){
  15. }
  16. }