"New" keyword in java
new
does (roughly) the following:- Find a contiguous free block of heap memory equal to the instance size of the class you're creating, plus some space for bookkeeping
- Zero said space & remove it from the free list
- Run the constructor
- Return a reference (NOT a pointer) to the created instance.
Comments
Post a Comment