ˇˇJava is Garbage Collected

  

You do not need to explicitly allocate or deallocate memory in Java. Memory is allocated as needed, both on the stack and the heap, and reclaimed by the garbage collector when it is no longer needed. There's no malloc(), free(), or destructor methods.

There are constructors and these do allocate memory on the heap, but this is transparent to the programmer.

Most Java virtual machines use an inefficient, mark and sweep garbage collector.

ˇˇ

List | Previous | Next