Local Variable
why is it necessary to initialize local variables before using it?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 25, 2014, 11:33 AM
The Java compiler issues an error if you haven't initialized the variable before usage to prevent such a bug from occurring.
Unlike C/C++, Java is a very safe language.
Pratiyush AnandPosted Feb 25, 2014, 11:26 AM
VulpesPosted Feb 25, 2014, 9:51 AM
This could lead to some serious and hard to find bugs.