Ali has Published 41 Articles

Do local variables in Java have default values?

Ali

Ali

Updated on 30-Jul-2019 22:30:20

898 Views

No, local variables do not have default values. Once we create a local variable we must initialize it before using it. Since the local variables in Java are stored in stack in JVM there is a chance of getting the previous value as default value. Therefore, In Java default values ... Read More

Advertisements