public class IntegerToStringBase {
public static void main(String[] args) {
int number = 255; // Example integer
int base = 16; // Example base (hexadecimal)
// Convert integer to string in the specified base
String result = Integer.toString(number, base).toUpperCase();
System.out.println("Number in base " + base + ": " + result);
}
}
/*
run:
Number in base 16: FF
*/