Java program to convert from octal to hexadecimal number. In a java program, convert an octal number to a hexadecimal number. This isn’t your typical octal to hexadecimal converter. The octal numeral system, also known as oct, is a base-8 numbering system that employs the digits 0 through 7. By grouping consecutive binary digits into groups of three, octal numerals can be generated from binary numerals. Relating to or using a system of numerical notation with a foundation of 16 rather than 10.

## Hexadecimal Function in Java

The Hexadecimal Number System is a type of numerical representation with the number 16 as the base number. That means there are only 16 possible digit values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Only four bits are required to express the value of any digit.

## Octal Function in Java

The octal numeral system, sometimes known as oct, is a base-8 numbering system that use the numerals 0 through 7. By arranging consecutive binary digits into groups of three, octal numerals can be created from binary numerals (starting from the right). The binary representation of decimal 74, for example, is 1001010.

```
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
String octalnumber, hexadecimal;
int decimalnum;
Scanner scan = new Scanner(System.in);
System.out.print("Enter Octal Number ");
octalnumber = scan.nextLine();
decimalnum = Integer.parseInt(octalnumber, 8);
hexadecimal = Integer.toHexString(decimalnum);
System.out.print("Hexadecimal" + octalnumber
+ " is :\n");
System.out.print(hexadecimal);
}
}
```

Output:

Enter Octal Number : 56

Equivalent Hexadecimal Value of 56 is : 2e

Fibonacci Series Program in PHP Using For Loop

Calculator Program in PHP Using If Else

Number in Reverse Order in PHP

Multiplication of Two Numbers in PHP

Reverse a String in PHP Using strrev

C++ Program to Find the Smallest Element Missing in a Sorted Array