Size of an arraylist in bytes

A

Arne Vajhøj

Dogs and wolves are the same species. They can interbreed.

Java pointers *are* pointers - and that's all they are. They don't pretend to do arithmetic on themselves. That does not make them less a pointer.

The essence of pointers is that they point. The implicit 'const' on them (in C terms) doesn't change that a jot.


Why would you say such a bone-headed thing, and what difference does it make? A pointer is a pointer still, if it but points, though you cannot increment it.

No one is claiming that they're "C-style" pointers. so we'll throw that red herring back in the water.

What is the difference between pointers for someone from a C background
and C style pointers?

Arne
 
L

Lew

Arne said:
What is the difference between pointers for someone from a C background
and C style pointers?

"Pointers" are things defined generally for computer science and don't really depend on one's background any more than does the definition of "photon".. "C-style pointer" is a colloquial way to express the connotative packageof assumptions about the attributes and behaviors of pointers made by those with a background in "C", or really any non-Java language. One of Java'sinnovations (or errors, depending on your outlook) was the removal of mostof the attributes and behaviors those with a C background tend to associate with pointers. Only the core notion that they point to the location of an object remained, pretty much. No more arithmetic, no more wild pointing into spaces beyond allocated memory, no more aliasing pointers to differenttypes. The notion of pointer was bound much more tightly to the underlying type in Java than in C. In keeping, somewhat, with C/C++ usage and more general computer programming terminology, Java primarily uses the term "reference", which I suppose carries more connotations of fixed target and tightly-bound type. Still, they took pains to note in the JLS that references are pointers.

So, summary: "pointers" are what they are regardless of one's background, "C-style pointers" are pointers implemented with the attributes and behaviors that pointers possess in C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top