No - octal numbers use only the digits 0-7.
Chat with our AI personalities
A45C: Decimal = 42076 Octal = 122134
BB895C: Octal = 56704534 Decimal = 12290396
Not sure is what respect, but when you want a variable to be read as an octal put a 0 in front of the number. a = 01, b = 02; Lets the compiler know that 1 and 2 are to be stored as octals. To print an unsigned number as an octal use %o.
Octal 124
public class Dataconversion { public static void main(String[] args) { System.out.println("Data types conversion example!"); int in = 44; System.out.println("Integer: " + in); //integer to binary String by = Integer.toBinaryString(in); System.out.println("Byte: " + by); //integer to hexadecimal String hex = Integer.toHexString(in); System.out.println("Hexa decimal: " + hex); //integer to octal String oct = Integer.toOctalString(in); System.out.println("Octal: " + oct); } }