Java strictly specifies a range and behavior for each primitive type, which all implementations of the Java Virtual Machine (JVM) must support. Because of Java’s portability requirement, Java is uncompromising on this account.
For example, an int is the same in all execution environments. This allows programs to be fully portable.
There is no need to rewrite code to fit a specific platform. Although strictly specifying the size of the primitive types may cause a small loss of performance in some environments, it is necessary in order to achieve portability.