Is it true that Primitive data types contains so many undergroups, and what is really the difference? NUMBERS that contain 2 undergroups called INTEGERS AND REAL NUMBERS INTEGERS contains 4 undergroups called / byte / short / int / long REAL NUMBERS contain 2 undergroups called / double / float CHARACTERS that contain 2 undergroups called / char / string LOGICAL that contain 1 undergroup called / boolean
The main difference i think is the memory size need for each one, for instance, int spend more memory than a byte. For small or embedded systems is a big difference.
in unsigned byte you can store digit between 0~255 or in hex 0x0~0xFF byte contains bit, bit can be 0 or 1 and represent power of base 2 255 = 2^0 + 2^1 + ... + 2^7 binary 11111111 = decimal 255 = hex FF if byte is signed then you can store number between -127 ~ +127 binary (1)1111111 where (1) represent sign for positive or negative number byte reserve one byte in ram memory. same story is for word data type ... word reserve 2 byte in ram memory, it can store digits 0~65635 char is same like unsigned byte (polymorphism) and string is array of char terminated with null character.