I read that pointers are not available in Java. But "This" pointer in C++ is replaced by "This" Keyword. So can someone explain about dynamic memory allocation and replacement for pointers in java
There are no pointers in java. Java works with references.
There is no concept of dynamic memory allocation in java. And hence there is no alternative of malloc/calloc in java. The JVM takes care of creating and releasing the memory for objects. As JVM has built in functionality of garbage collection hence no alternative to free is also provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With