Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Java - Why Java provides default constructor ?

At the beginning of an object's life, the Java virtual machine (JVM) allocates memory on the heap to accommodate the object's instance variables. When that memory is first allocated, however, the data it contains is unpredictable. If the memory were used as is, the behavior of the object would also be unpredictable. To guard against such a scenario, Java makes certain that memory is initialized, at least to predictable default values before it is used by any code.




This post first appeared on Techsharepoint, please read the originial post: here

Share the post

Java - Why Java provides default constructor ?

×

Subscribe to Techsharepoint

Get updates delivered right to your inbox!

Thank you for your subscription

×