4 ms·
In C++ you're right. The value isn't predefined unless you calloc. In java there are default values. I.e. for an int it's 0 and a string it's an empty string.
by monksy 10y ago
In C++ you're right. The value isn't predefined unless you calloc. In java there are default values. I.e. for an int it's 0 and a string it's an empty string. There is even a Checkstyle violation for this style choice.
- rezashirazian 10y agoOr in Swift, you either initialize a variable with a value or have to define it as an optional, in which case you are eventually forced to deal with its possible null state. But I digress