Why Pointers are Eliminated in Java?

 This is rare question but it is good to get prepared with such type of Questions as it may be asked in Beginner level.

  • The first motivation is to make Java programming less complicated. Java is an easy-to-learn, object-oriented programming language. As is well known, the pointer idea is very confusing, challenging to understand (especially for beginners), and leads to coding errors. 

  • The pointers concept was eliminated by the designers of Java in order to make it less complicated and more straightforward.

  • Memory can be allocated and deallocated via pointers. Although this is a useful aspect of pointers, manually managing memory can occasionally be challenging for programmers. Pointers are not required because Java has an automatic garbage collection mechanism, which simplifies memory management.

  • One of the major problems in the field of programming is security. Direct access to a memory address is provided through a pointer. As a result, it is simple to access any memory region and perform read and write operations on it.
  • This can lead to a security breach. In order to make Java secure, pointers are not supported. Java has a secure and strong feature set.



Comments

Popular posts from this blog

What is the advancement made in Hashmap in Java 8?

Integer.parseInt(“text”)