Was there any reason why the designers of Java felt that local variables should not be given a default value? Seriously, if instance variables can be given a default value,
if i am not wrong,Another reason could be
Giving default value of member variables is part of class loading
Class loading is a run time thing in java means when you create an object then the class is loaded with class loading only member variables are initialized with default value JVM does not take time to give default value to your local variables because some methods will never be called because method call can be conditional so why take time to give them default value and reduce performance if those defaults are never going to be used.