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#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -