DuoDecimal in Java
Duodecimal represents a system which is a notation system in which a number having its base as 12 is called a duodecimal number. In java, we can use to find the conversation of duodecimal numbers into respective binary, octal, decimal, hexadecimal number, or any other base numbers. In java, we can use predefined packages or user-defined methods to perform the following conversion.
Let us portray out few sample sets of duodecimal conversation into other based numbers which are listed below as follows:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
The duodecimal number of (15b)12 is converted to the binary number (11010111)2
The duodecimal number of (182)12 is converted to the octal number (362)8
The duodecimal number of (262)12 is converted to the decimal number (362)10
The duodecimal number of(288052)12 is converted to the hexadecimal number (A563E)16
The duodecimal number of (58576a2)12 is converted to the hexatrigesimal number (A563E)32
There are certain steps required to convert into a duodecimal number which is listed below as follows:
- Take a hexadecimal number as user input.
- Create a user-defined function to convert it into a decimal number.
- Create another user-defined function that will convert a decimal number into a duodecimal number.
- Print the resultant duodecimal number.
Duodecimal : B622A