Re: why java does not support pointers
- From: "ricky.clarkson@xxxxxxxxx" <ricky.clarkson@xxxxxxxxx>
- Date: 31 Dec 2005 04:17:42 -0800
The Java Language Specification defines a reference as:
"An object is a class instance or an array.
The reference values (often just references) are pointers to these
objects, and a special null reference, which refers to no object."
From
http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#106237
Java supports pointers.
However, Java doesn't support pointer arithmetic (well, it does, as of
Java 1.5, but I'm not interested in telling you how). It doesn't
support converting an int to a pointer either.
This is much better, because we can now write code that won't cause
segfaults or General Protection Faults. Instead we get a nasty old
NullPointerException, for different reasons.
Recent Usenet addicts will note that I haven't taken this delightful
opportunity to post a link to a certain article..
Cheers.
.
- References:
- why java does not support pointers
- From: chandu
- Re: why java does not support pointers
- From: Luke Meyers
- why java does not support pointers
- Prev by Date: Re: How to dedect 4 consecutive space
- Next by Date: Re: NullPointerException
- Previous by thread: Re: why java does not support pointers
- Next by thread: Re: why java does not support pointers
- Index(es):
Relevant Pages
|