By: Jimmy Pan
0x
in front of it. Also generate a random number from 1 to 16777215.
0xfa12ce
is what we call a hexadecimal number.public static void main(String[] args) {
Object[] numbers = generateRandomNumbers();
String hex = (String) numbers[0];
int dec = (int) numbers[1];
System.out.printf("Random Hexadecimal Number: %s%n", hex);
System.out.printf("Random Decimal Number: %d%n", dec);
}