Re: arrays and variables
On 06.04.2013 10:11, lipska the kat wrote:
On 05/04/13 21:33, Lew wrote:
lipska the kat wrote:
Stefan Ram wrote:
Arved Sandstrom writes:
Stefan Ram wrote:
Arved Sandstrom writes:
[snip]
What is C? We have pointers in Java, see the JLS.
Do we? I never knew that
It's in the JLS, 4.3.1.
"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."
This is a rhetorical usage of the word pointer and says nothing about
the underlying mechanism used to implement references.
Why "rhetorical"? You seem to imply that "pointer" and "memory address"
are synonymous. But this is not necessarily the case even though
personally I tend to also use it that way.
<pssst>I think Lew enjoys it from time to time to prove someone wrong
who claims there are no pointers in Java because it is often surprising
for Java programmers to find that p-word in the JLS. :-)</pssst>
It only has pointers for reference types
Weasel words, I don't believe that you actually believe that.
Why and why? There is nothing weaselish about quoting the JLS. Do you
have a definition of the Java language with higher authority that does
not contain the word "pointer"?
A reference is an abstraction of a pointer, [...]
I think most people in software engineering actually use the terms the
way you have presented them here which is also reflected in the article
about pointers on wikipedia. That does not preclude other usages in
specific context so the heads up of Lew is actually in order to keep us
alert and use terms consciously.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/