import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.print("0"+Integer.toOctalString(1234)+" ");//8进制 String sixteen=Integer.toHexString(1234);//16进制 System.out.println("0X"+sixteen.toUpperCase());//需大写 } }