Why java has fixed data type size unlike C
问题 In C as we know the size of data types (ex. int) can vary depending on compiler / hardware. But why the size of data types is constant in java language? Why don't we have the flexibility for different data type size in java depending on compiler? 回答1: The JVM (Java Virtual Machine) is designed to be platform independent. If data type sizes were different across platforms, then cross-platform consistency is sacrificed. The JVM isolates the program from the underlying OS and platform. This can