Monday, April 30, 2007

Why Java does not support pointers?

As per the design decision Java does not support pointers explicitly.This greatly reduces the burden of dynamic memory management while coding from programmers.Though programmers dynamically allocate memory while coding but they need not worry about deallocating this memory.The automatic garbage collection feature of Java collects dangling references of objects though it has a trade off on performance as programmer managed memory management will be efficient as compared to JVM driven automatic garbage collection.


Anonymous said...

The garbage collection point is true, but don't we also need to mention the fact that pointers would make the programs more closely coupled with the system, which would kill the purpose of platform independence in Java?

Anonymous said...

bal chal doesn't support the pointer concept..because jvm takes care of memory allocation by a programmer need not have to worry about allocating or reallocating of memory...

lingmaaki on May 18, 2017 at 3:22 AM said...

Most studies agree that pointers are one of the primary features that enable developers to inject bugs into their code. When Java was created, the intention was to create a language that is easy to learn and not prone to the bugs that C++ is prone to. It's not like c/c++ where we have to manage the memory management by destructors. In java automatic Garbage Collector works for memory management. Actually, Java references are pointers so everything in Java is accessed only through pointers.

Check this....Some reasons for Java does not support Pointers



Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker