Compared with global variables, local variables have a short life cycle and are declared many times. If an initial value is given like a global variable, it will affect performance. Not giving an initial value is unsafe, so we made a compromise and stipulated that users need to first Assign value and use again.
The compiler cannot pass
If there is no initialization, just point to an address similar to c. So the direct compilation of java failed.
Compared with global variables, local variables have a short life cycle and are declared many times. If an initial value is given like a global variable, it will affect performance. Not giving an initial value is unsafe, so we made a compromise and stipulated that users need to first Assign value and use again.