Why is an object initialization using the new keyword called dynamic memory allocation, since compile time itself we need to know the memory needed for that object.
Also please explain what happens when you do ClassA object = new ClassA(); in heap and stack .