octal to hexadecimal in java
import java.util.Scanner;
public class OctalToHexadecimal
{
public static void main(String[] args)
{
String strOctalNumber, strHexNumber;
Scanner sc = new Scanner(System.in);
System.out.print("Please enter octal number: ");
strOctalNumber = sc.nextLine();
int decimalNumber = Integer.parseInt(strOctalNumber, 8);
strHexNumber = Integer.toHexString(decimalNumber);
System.out.print("Hexadecimal value of " + strOctalNumber + " is: \n");
System.out.print(strHexNumber);
sc.close();
}
}