Google News
logo
Java - Interview Questions
What is the default value of the local variables?
The local variables are not initialized to any default value, neither primitives nor object references. If you try to use these variables without initializing them  explicitly, the java compiler will not compile the code. It will complain about the local variable not being initialized.
Advertisement