Re: why java does not support 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,
e.g., C. The decision to have it this way has to do with the design
principles of Java. Security and portability are probably two of the
main ones. In Java, can you access uninitialized or deallocated
memory? Well, that's because of the lack of pointers. Like it or lump
it, that's Java.

Luke

.



Relevant Pages

  • Re: The Java no pointer big fat lie!
    ... > reference types, it wouldn't be a good comparison. ... and what you can't - and there is a big difference in Java to C and C++. ... You cannot change it in the language itself, ... Thus I would distinguish pointers from ...
    (comp.lang.java.programmer)
  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... What matters is that Lisp teaches students to use ... recursion, because they have to. ... Java does NOT teach students to use ... pointers and recursion, she'll be able to understand anything, and get ...
    (comp.programming)
  • Re: Java
    ... >> seem to me to be one of the major uses of pointers. ... >As soon as I see a production OS built on java and not assembler at the ... seem like a good choice for writing an operating system. ... needs to be taught, and can't be taught using Java. ...
    (comp.programming)
  • Re: A simple ADA puzzle (I havent the answer)
    ... New Ada users, ... write a simple record type that, without any additional memory allocation, ... Java, by its very nature, would require a pointer ... since all Java classes and arrays are handled via pointers. ...
    (comp.lang.ada)
  • Re: some java concepts query
    ... > I am learning Java. ... The basic idea is very similar to pointers in other ... past the declaration of the variable. ... However, if the argument in question is a reference, both copies ...
    (comp.lang.java.help)