WHY JAVA DOES NOT HAVE POINTERS

.................................................................................................................

Well, it's debatable whether Java does or doesn't support pointers.Some would say that everything (well, every reference type) in Java is a pointer -- hence, the ever-familiar NullPointerException. But certainly, these reference types do not give one the sort of direct interaction with memory that we're familiar with from pointers in. Instead, all objects are handled by references, not to be confused with pointers or C++ references. The difference is that Java references do not refer directly to the memory location, but rather contain the pointer to the actual memory location, which the programmer cannot get direct access to.

It is also true that pointers are dangerous and lead to memory leaks, memory corruption, invalid memory access, e.g. from uninitialized and improperly initialized variables, indexing out of bounds, and many bugs due to pointer arithmetic. References, and other features related to these, avoid all these problems.

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. its a powerful framework....which need only business logic thats all..no memory leak hav pointer...powerful CLR, garbage collector....biggest libraries .... support more than 75 language isnt is graet u do not hav to change ur fav language easily switch 2 .net... if u love java so much u can switch 2 j# .net easily feel d diffrence...

    New Features in the Visual Studio 2010 IDE and .NET Framework 4.0

    * Call Hierarchy of methods
    * A New Quick Search
    * Multi-targeting more accurate
    * Parallel Programming and Debugging
    * XSLT Profiling and Debugging
    * The XSD Designer

    New ASP.NET features

    * Static IDs for ASP.NET Controls
    * The Chart control
    * Web.config transformation

    New VB.NET features

    * Auto Implemented Properties for VB.NET
    * Collection Initializers
    * Implicit Line Continuations
    * Statements in Lambda Expressions

    New C# features

    * Dynamic Types
    * Optional parameters
    * Named and Optional Arguments

    ReplyDelete

Post a Comment

Popular posts from this blog

Arrays.sort() and Collections.sort() NullPointerException

org.xml.sax. SAXParseException: Element type "web-app" must be declared.

Sentimental Analysis : PART 1