+ 3

Java without pointers is that a bad thing ?

question about java

14th Jun 2017, 3:21 AM
Houssem Trabelsi
Houssem Trabelsi - avatar
2 Respostas
+ 1
Programming languages that use pointers rely on you alone, as the programmer, to manage the memory that your program uses. It is up to you to make sure that memory is allocated and properly deallocated to ensure that memory leaks are not a problem. Languages like Java that have eliminated the use of pointers (at least in the foreground) usually use some form of garbage collection allowing the JVM/OS etc to manage and free up deallocated memory. This, however, does not mean that Java can't create memory leaks https://stackoverflow.com/questions/6470651/creating-a-memory-leak-with-java. Then there is the performance side of things. Languages that require the programmer to manage memory provide better performance as they are typically lower level languages.
14th Jun 2017, 4:07 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
nope , reference are pretty much powerful in java , the main difference was experienced in cpp , where reference have less usability than pointers , the fact that reference cant be null or cant be reused , is fixed in java , and its pretty much safer
18th Dec 2017, 2:03 PM
Maher Zaidoune
Maher Zaidoune - avatar