IntegerPrinter.java 653B

12345678910111213141516171819202122232425262728293031
  1. import java.util.Scanner;
  2. public class IntegerPrinter {
  3. Scanner scan = new Scanner(System.in);
  4. public String printIntegerAsBinary(int value){
  5. //value = scan.nextInt();
  6. return Integer.toBinaryString(value);
  7. }
  8. public String printIntegerAsOctal(int value){
  9. return Integer.toOctalString(value);
  10. }
  11. public String printIntegerAsHexadecimal(int value){
  12. //value = scan.nextInt();
  13. return Integer.toHexString(value);
  14. }
  15. public static void main(String[] args){
  16. IntegerPrinter print = new IntegerPrinter();
  17. }
  18. }