This item shows the overflow in different data types: char, short, int, long, float, and double. The following table from an earlier quiz shows that for byte or char, 5! = 120, and 6! should be computed as 720, but displayed as -48 due to overflow. The table below shows that when we calculate n! for byte (char), short, and int, up t n = 15, they all overflow as you can see from the negative value for short (and we know 13! for int is wrong).
Long data type does not overflow here. It overflows at n = 21. Float and double will also overflow with bigger n (that n is less than 200. Want to try?).