IntegerPrinter.java 609B

12345678910111213141516171819202122232425262728293031
  1. public class IntegerPrinter {
  2. public String printIntegerAsBinary(int value){
  3. String strBinary = Integer.toBinaryString(value);
  4. return strBinary;
  5. }
  6. public String printIntegerAsOctal(int value){
  7. String strOctal = Integer.toOctalString(value);
  8. return strOctal;
  9. }
  10. public String printIntegerAsHexadecimal(int value){
  11. String strHexa = Integer.toHexString(value);
  12. return strHexa;
  13. }
  14. public static void main(String[] args){
  15. IntegerPrinter intPrint = new IntegerPrinter();
  16. }
  17. }