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.

2 comments :

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 question..java doesn't support the pointer concept..because jvm takes care of memory allocation by itself..so a programmer need not have to worry about allocating or reallocating of memory...

 

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