java - Default values of instance variables and local variables -


i read java provides default values class properties not local variables. correct? if reason behind this? when doing good, why not way?

thanks,
roger

standard local variables stored on stack , aren't created until initialized. if local variable isn't used, doesn't go on stack. member variables, however, allocated in heap, , thusly have default placeholder (null reference or default primitive).


Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -