1

Java creates every object in the heap space.
And when the heap space is full, it will throw a java.lang.OutOfMemoryError: Java heap space.

How does java allocate the memory and create the OutOfMemoryError object when there is no space in the heap?

Syam Kumar S
  • 832
  • 2
  • 8
  • 26

1 Answers1

0

It will overwrite an object and allocate the exception.