Hexadecimal refers to a numbering system that has a base of 16. This means it uses all the numerals 0,1,2,3,4,5,6,7,8,9 as well as the letters A,B,C,D,E,F for each digit of a number. In a similar way that a language such as Italian represents the English word 'number' as 'numero', hexadecimal represents the denary number of 122 as 7A. It's just another system to represent the same value.
To show the progression of the hexadecimal numbering system, look at the hexadecimal values below as they are converted from denary numbers. Note that once it gets to ten the hexadecimal system uses letters:
Denary=Hexadecimal;0=0;1=1;2=2;3=3;4=4;5=5;6=6;7=7;8=8;9=9;10=A;11=B;12=C;13=D;14=E;15=F;16=10; and so on.
The hexadecimal system is a compact way to represent bits. Each hexadecimal digit can represent four bits i.e., a hexadecimal digit can represent 16 values (0-15), this is exactly the same as four bits (1111). Due to this perfect conversion and that modern day computers are designed around the byte (8 bits), hexadecimal is a widely used method to represent binary numbers.
In java, to represent a hexadecimal number as a literal use a leading zero followed by an x.
e.g., The following will return the value of 122 for the hexadecimal number 7A:
int hexNumber = 0x7A; System.out.println(hexNumber);