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

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -