what do i need to change if i want this program to convert decimal to hexadecimal thanks.
package dectooctal;
import java.util.Scanner;
public class Dectooctal {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int broj;
System.out.print("ENTER NUMBER THAT YOU WANT TO CONVERT TO OCTAL: ");
broj = input.nextInt();
convert(broj);
}
public static void convert (int a){
String obrnuti =" ";
while (a>0){
int x = a%8;
obrnuti += x;
a/=8;
}
System.out.println(reverse(obrnuti));
}
public static String reverse(String a){
String novi =" ";
for (int i=a.length()-1;i>=0; i--){
char c = a.charAt(i);
novi += c;
}
return novi;
}
}