IntegerPrinter.java 588B

123456789101112131415161718192021222324252627
  1. public class IntegerPrinter {
  2. private String binaryValue;
  3. private String octalValue;
  4. private String hexValue;
  5. public String printIntegerAsBinary(int value){
  6. binaryValue = Integer.toBinaryString(value);
  7. return binaryValue;
  8. }
  9. public String printIntegerAsOctal(int value){
  10. octalValue = Integer.toOctalString(value);
  11. return octalValue;
  12. }
  13. public String printIntegerAsHexadecimal(int value){
  14. hexValue = Integer.toHexString(value);
  15. return hexValue;
  16. }
  17. public static void main(String[] args){
  18. }
  19. }