<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pointer</id>
		<title>Pointer - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pointer"/>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;action=history"/>
		<updated>2026-05-09T09:26:44Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1679&amp;oldid=prev</id>
		<title>Brian: /* Java, C#, Python, Ruby, etc. */</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1679&amp;oldid=prev"/>
				<updated>2012-08-01T19:59:25Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Java, C#, Python, Ruby, etc.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:59, 1 August 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L197&quot; &gt;Line 197:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 197:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is clear from this example that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are not value ''instances'' of the class &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;; if they were, then the statement &amp;lt;code&amp;gt;g = f;&amp;lt;/code&amp;gt; would create a copy of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. Instead, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are like pointers with an anonymous referent constructed by the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; invocation, so that after &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is assigned to &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, the two pointers will have the same referent. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;On the other hand, in semantics, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are more like C++ references; it would not make sense to use &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; operators because these Java pointers do not exist independently of their referents; only one or the other is exposed in the language proper. (Primitive types such as &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; cannot be referred to with pointers, and they cannot be passed by reference.)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is clear from this example that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are not value ''instances'' of the class &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;; if they were, then the statement &amp;lt;code&amp;gt;g = f;&amp;lt;/code&amp;gt; would create a copy of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. Instead, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are like pointers with an anonymous referent constructed by the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; invocation, so that after &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is assigned to &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, the two pointers will have the same referent.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When an object is passed into a function, it is as though a pointer to the object's data were passed into a C function. Hence, if a function takes a parameter &amp;lt;code&amp;gt;Foo f&amp;lt;/code&amp;gt;, then assigning to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; inside the function will simply rebind the name, and leave the original argument untouched; but any modification to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;'s members will be reflected in the original argument, as it entails the dereferencing of this pointer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When an object is passed into a function, it is as though a pointer to the object's data were passed into a C function. Hence, if a function takes a parameter &amp;lt;code&amp;gt;Foo f&amp;lt;/code&amp;gt;, then assigning to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; inside the function will simply rebind the name, and leave the original argument untouched; but any modification to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;'s members will be reflected in the original argument, as it entails the dereferencing of this pointer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;One can also argue about whether Java passes parameters by value or by reference. If &lt;/del&gt;we &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;insist that Java passes all parameters by value, then we must accept that &lt;/del&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;f&lt;/del&gt;&amp;lt;/code&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; and &lt;/del&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;g&lt;/del&gt;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;have pointer nature&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;because if &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;passed into &lt;/del&gt;a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;function, and &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;parameter &lt;/del&gt;that &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;receives &lt;/del&gt;it is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;reassigned via the assignment operator&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;then &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;unchanged, but if &lt;/del&gt;a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;method is called on the parameter that mutates a data member of &lt;/del&gt;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Foo&lt;/del&gt;&amp;lt;/code&amp;gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;then those changes will &lt;/del&gt;be &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;reflected &lt;/del&gt;in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;, which is just what we would expect if &lt;/del&gt;a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;C++ &lt;/del&gt;pointer &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;were passed (and &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;method called with the &amp;lt;code&amp;gt;-&amp;gt;&amp;lt;/code&amp;gt; operator)&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;However, &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lack of independent existence of pointers and their referents is taken by &lt;/del&gt;some &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;to imply &lt;/del&gt;that &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Java cannot really said to possess pointers. Thus, there is considerable controversy over &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;question of whether Java has &lt;/del&gt;pointers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Whereas in C &lt;/ins&gt;we &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;may have something like this:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight lang=&amp;quot;c&amp;quot;&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;typedef struct node&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; int value;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; struct node* left;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; struct node* right;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;} node;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the equivalent &lt;/ins&gt;code &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;in Java would be:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight lang=&amp;quot;java&amp;quot;&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class Node&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; public:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; int value;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; Node left;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; Node right;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;In the sense that pointers are necessary for the implementation of linked data structures&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Java does have pointers; they are simply not presented as such to the programmer. The question &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;whether an entity can be called &lt;/ins&gt;a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pointer when its referent cannot be independently exposed in &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;language (in &lt;/ins&gt;that it is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;impossible to pass an object &amp;quot;by value&amp;quot;). Also&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;there &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;no way to pass &lt;/ins&gt;a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;primitive type such as &lt;/ins&gt;&amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;int&lt;/ins&gt;&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;by reference&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;as would &lt;/ins&gt;be &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;done &lt;/ins&gt;in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;C with &lt;/ins&gt;a pointer &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to int; &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;int must instead be wrapped in an object&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The inability of &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;programmer to create a reference to &lt;/ins&gt;some &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;data types may be a reason for saying &lt;/ins&gt;that the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;language does not have &lt;/ins&gt;pointers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The names &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;at any rate, probably do not refer &lt;/del&gt;to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;fixed memory addresses; this stands in contrast &lt;/del&gt;to C&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, where pointers probably &lt;/del&gt;'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'do'' refer to fixed memory addresses (but this is not required &lt;/del&gt;by &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the standard). This is because &lt;/del&gt;Java&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'s automatic memory management &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;allowed to move values around in memory, and &lt;/del&gt;&amp;quot;pointers&amp;quot; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;must therefore be defined in a way that allows them to follow this movement&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Of course&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the knowledge of how &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;achieve equivalent effects &lt;/ins&gt;to C'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;s &amp;quot;pass &lt;/ins&gt;by &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;value&amp;quot; and &amp;quot;pass by reference&amp;quot; in &lt;/ins&gt;Java &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and languages with similar reference semantics &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;far more important than a squabble over whether a language &lt;/ins&gt;&amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;has &lt;/ins&gt;pointers&amp;quot; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;or not&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- TODO: Talk about Lisp, Scheme, Haskell, ML, and Perl --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- TODO: Talk about Lisp, Scheme, Haskell, ML, and Perl --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1678&amp;oldid=prev</id>
		<title>Brian: /* Java, C#, Python, Ruby, etc. */</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1678&amp;oldid=prev"/>
				<updated>2012-08-01T19:43:52Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Java, C#, Python, Ruby, etc.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:43, 1 August 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L198&quot; &gt;Line 198:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 198:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is clear from this example that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are not value ''instances'' of the class &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;; if they were, then the statement &amp;lt;code&amp;gt;g = f;&amp;lt;/code&amp;gt; would create a copy of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. Instead, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are like pointers with an anonymous referent constructed by the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; invocation, so that after &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is assigned to &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, the two pointers will have the same referent. On the other hand, in semantics, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are more like C++ references; it would not make sense to use &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; operators because these Java pointers do not exist independently of their referents; only one or the other is exposed in the language proper. (Primitive types such as &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; cannot be referred to with pointers, and they cannot be passed by reference.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is clear from this example that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are not value ''instances'' of the class &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;; if they were, then the statement &amp;lt;code&amp;gt;g = f;&amp;lt;/code&amp;gt; would create a copy of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. Instead, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are like pointers with an anonymous referent constructed by the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; invocation, so that after &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is assigned to &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, the two pointers will have the same referent. On the other hand, in semantics, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are more like C++ references; it would not make sense to use &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; operators because these Java pointers do not exist independently of their referents; only one or the other is exposed in the language proper. (Primitive types such as &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; cannot be referred to with pointers, and they cannot be passed by reference.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;When an object is passed into a function, it is as though a pointer to the object's data were passed into a C function. Hence, if a function takes a parameter &amp;lt;code&amp;gt;Foo f&amp;lt;/code&amp;gt;, then assigning to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; inside the function will simply rebind the name, and leave the original argument untouched; but any modification to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;'s members will be reflected in the original argument, as it entails the dereferencing of this pointer.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One can also argue about whether Java passes parameters by value or by reference. If we insist that Java passes all parameters by value, then we must accept that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; have pointer nature, because if &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is passed into a function, and the parameter that receives it is reassigned via the assignment operator, then &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is unchanged, but if a method is called on the parameter that mutates a data member of &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;, then those changes will be reflected in &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;, which is just what we would expect if a C++ pointer were passed (and the method called with the &amp;lt;code&amp;gt;-&amp;gt;&amp;lt;/code&amp;gt; operator). However, the lack of independent existence of pointers and their referents is taken by some to imply that Java cannot really said to possess pointers. Thus, there is considerable controversy over the question of whether Java has pointers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One can also argue about whether Java passes parameters by value or by reference. If we insist that Java passes all parameters by value, then we must accept that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; have pointer nature, because if &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is passed into a function, and the parameter that receives it is reassigned via the assignment operator, then &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is unchanged, but if a method is called on the parameter that mutates a data member of &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;, then those changes will be reflected in &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;, which is just what we would expect if a C++ pointer were passed (and the method called with the &amp;lt;code&amp;gt;-&amp;gt;&amp;lt;/code&amp;gt; operator). However, the lack of independent existence of pointers and their referents is taken by some to imply that Java cannot really said to possess pointers. Thus, there is considerable controversy over the question of whether Java has pointers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L203&quot; &gt;Line 203:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 205:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The names &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, at any rate, probably do not refer to fixed memory addresses; this stands in contrast to C, where pointers probably ''do'' refer to fixed memory addresses (but this is not required by the standard). This is because Java's automatic memory management is allowed to move values around in memory, and &amp;quot;pointers&amp;quot; must therefore be defined in a way that allows them to follow this movement.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The names &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, at any rate, probably do not refer to fixed memory addresses; this stands in contrast to C, where pointers probably ''do'' refer to fixed memory addresses (but this is not required by the standard). This is because Java's automatic memory management is allowed to move values around in memory, and &amp;quot;pointers&amp;quot; must therefore be defined in a way that allows them to follow this movement.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- TODO: Talk about Lisp, Scheme, Haskell, ML, and Perl --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- TODO: Talk about Lisp, Scheme, Haskell, ML, and Perl --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Disk (and other) pointers===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Disk (and other) pointers===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File systems that organize data on disks also use pointers to keep track of where on the disk files are located; however, these are typically specialized data structures handled by an operating system kernel, and do not appear in application programs or in mainstream programming languages. These ''disk pointers'' are usually referred to as such to distinguish them from pointers into primary storage and virtual memory, which are simply called ''pointers''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File systems that organize data on disks also use pointers to keep track of where on the disk files are located; however, these are typically specialized data structures handled by an operating system kernel, and do not appear in application programs or in mainstream programming languages. These ''disk pointers'' are usually referred to as such to distinguish them from pointers into primary storage and virtual memory, which are simply called ''pointers''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The term ''memory'' can, in general, refer not only to primary storage, disks, and virtual memory, but also to CPU registers, cache, and other machines (as in a network cluster). Nevertheless, the term ''pointer'' is very rarely used to describe objects that address these other forms of memory. For example, an IP address is not referred to as a pointer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The term ''memory'' can, in general, refer not only to primary storage, disks, and virtual memory, but also to CPU registers, cache, and other machines (as in a network cluster). Nevertheless, the term ''pointer'' is very rarely used to describe objects that address these other forms of memory. For example, an IP address is not referred to as a pointer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1660&amp;oldid=prev</id>
		<title>Brian at 21:47, 14 June 2012</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1660&amp;oldid=prev"/>
				<updated>2012-06-14T21:47:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:47, 14 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''This article is intended to provide an introduction to and critical analysis of the concept of a pointer. Despite the samples of code shown below for various languages, it is not intended to provide a reference on how to use pointers in specific languages.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''This article is intended to provide an introduction to and critical analysis of the concept of a pointer. Despite the samples of code shown below for various languages, it is not intended to provide a reference on how to use pointers in specific languages.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''pointer''' is an object that contains information about the address of another object in memory (called the '''referent''' or the '''pointee''') and which may be used to access that object. Accessing an object using a pointer to it rather than by referring to the object itself is known as '''indirection'''; using a pointer is said to ''add a level of indirection''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''pointer''' is an object that contains information about the address of another object in memory (called the '''referent''' or the '''pointee''') and which may be used to access that object. Accessing an object using a pointer to it rather than by referring to the object itself is known as '''indirection'''; using a pointer is said to ''add a level of indirection''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. When we use a particular pointer to access its referent, we say that we are '''dereferencing''' the pointer&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definition==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Definition==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1601&amp;oldid=prev</id>
		<title>67.55.33.2: /* Pointers to member */</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1601&amp;oldid=prev"/>
				<updated>2012-02-18T08:45:44Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Pointers to member&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:45, 18 February 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L142&quot; &gt;Line 142:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 142:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; A a;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; A a;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; B b;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; B b;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; void (A::*p)(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;int&lt;/del&gt;) = &amp;amp;A::f;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; void (A::*p)() = &amp;amp;A::f;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; (a.*p)();&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; (a.*p)();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; (b.*p)();&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; (b.*p)();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>67.55.33.2</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1386&amp;oldid=prev</id>
		<title>Brian: this needs extensive revision</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Pointer&amp;diff=1386&amp;oldid=prev"/>
				<updated>2011-08-14T17:40:45Z</updated>
		
		<summary type="html">&lt;p&gt;this needs extensive revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;''This article is intended to provide an introduction to and critical analysis of the concept of a pointer. Despite the samples of code shown below for various languages, it is not intended to provide a reference on how to use pointers in specific languages.''&lt;br /&gt;
&lt;br /&gt;
A '''pointer''' is an object that contains information about the address of another object in memory (called the '''referent''' or the '''pointee''') and which may be used to access that object. Accessing an object using a pointer to it rather than by referring to the object itself is known as '''indirection'''; using a pointer is said to ''add a level of indirection''.&lt;br /&gt;
&lt;br /&gt;
==Definition==&lt;br /&gt;
The usage of the term ''pointer'' among programmers does not quite mirror the general definition given above. Whether or not certain objects can be considered pointers is subject to dispute. We consider a few examples:&lt;br /&gt;
&lt;br /&gt;
===C===&lt;br /&gt;
In C, a pointer is a first class object. A pointer may be used in any place where it is appropriate. Pointers may be assigned to each passed to functions, and returned from functions. They may be converted to other values, they may be printed on the screen, and they may be read from and written to files. To every C data type &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; there corresponds a pointer type &amp;lt;code&amp;gt;T*&amp;lt;/code&amp;gt;, and this is true even of pointers themselves; a pointer may point to another pointer. The programming community is in consensus that these objects are considered true pointers.&lt;br /&gt;
&lt;br /&gt;
The standard does not prescribe the ''nature'' of a pointer; however, C is, by design, close to the machine and efficient with computing time and memory, and, therefore, in essentially all implementations of C, a pointer is a raw memory address, that is, one that contains no more and no less information than is required in order to unambiguously specify the address of an object in primary storage (RAM/ROM) or virtual memory in a form that the CPU can use directly. Today, the vast majority of computing devices in existence operate in ''flat'' memory addressing; here, a pointer is simply an unsigned integer from 0 to &amp;lt;math&amp;gt;N-1&amp;lt;/math&amp;gt; (where &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the total size of available memory in bytes). The pointer that compares equal to the integer 0 is called the ''null pointer'' and is taken to mean a pointer that does not point to anything.&lt;br /&gt;
&lt;br /&gt;
Pascal and its descendants have pointers that are similar to C pointers, but more limited (in that they cannot be operands to arithmetic operators, nor can they be read and written like numeric and character types).&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int x = 123;&lt;br /&gt;
int* p = &amp;amp;x;&lt;br /&gt;
*p = 456;&lt;br /&gt;
printf(&amp;quot;%d\n&amp;quot;, x); /* This prints &amp;quot;456&amp;quot; */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is an integer and &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is a pointer to integer. In line 2, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is made to ''point'' to &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Beyond this point, &amp;lt;code&amp;gt;*p&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; are semantically indistinguishable; using the asterisk operator on &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is said to ''dereference'' the pointer, providing access to the referent. This remains the case until either &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; goes out of scope, or &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is reassigned to point somewhere else.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
void foo(int z)&lt;br /&gt;
{&lt;br /&gt;
    z = 456;&lt;br /&gt;
}&lt;br /&gt;
void bar(int* p)&lt;br /&gt;
{&lt;br /&gt;
    *p = 456;&lt;br /&gt;
}&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
    int x = 123;&lt;br /&gt;
    foo(x);&lt;br /&gt;
    printf(&amp;quot;%d\n&amp;quot;, x); /* This prints &amp;quot;123&amp;quot; */&lt;br /&gt;
    bar(&amp;amp;x);&lt;br /&gt;
    printf(&amp;quot;%d\n&amp;quot;, x); /* This prints &amp;quot;456&amp;quot; */&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example shows how pointers may be used to ''pass by reference''. If an integer variable is passed into a function, then a copy of the variable is made; any changes made to the parameter within the function will leave the variable in the caller unaffected. However, passing a pointer to &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; itself merely copies the ''address information'' of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;, which, within the body of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;, may still be used to refer to &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
====Function pointers====&lt;br /&gt;
Pointers to functions are also allowed. Unlike pointers to data types, these point to code, not data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
void f(int x)&lt;br /&gt;
{&lt;br /&gt;
    printf(&amp;quot;%d\n&amp;quot;, x);&lt;br /&gt;
}&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    void (*p)(int) = &amp;amp;f;&lt;br /&gt;
    (*p)(123); // prints &amp;quot;123&amp;quot; &lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The type &amp;lt;code&amp;gt;void (*)(int)&amp;lt;/code&amp;gt; is a ''pointer to function of &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; returning &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;''. When &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is declared, it is made to point to the function &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. Then, &amp;lt;code&amp;gt;*p&amp;lt;/code&amp;gt; will refer to &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. A function pointer is also a fully first-class data type. Pointers to function pointers are allowed, as are pointers to functions taking or returning function pointers; however, the syntax quickly becomes confusing.&lt;br /&gt;
&lt;br /&gt;
(Note that for function pointers the use of &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; are ''optional''; the syntax &amp;lt;code&amp;gt;void (*p)(int) = f;&amp;lt;/code&amp;gt; is correct, as is &amp;lt;code&amp;gt;p(123);&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===C++===&lt;br /&gt;
====References====&lt;br /&gt;
C++ inherits the &amp;quot;true&amp;quot; pointers found in C, but also has a type known as ''reference''. The reference type corresponding to the type &amp;lt;code&amp;gt;T&amp;lt;/code&amp;gt; is known as &amp;lt;code&amp;gt;T&amp;amp;&amp;lt;/code&amp;gt;. Here is an example to parallel the above:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int x = 123;&lt;br /&gt;
int&amp;amp; r = x;&lt;br /&gt;
r = 456;&lt;br /&gt;
std::cout &amp;lt;&amp;lt; x &amp;lt;&amp;lt; std::endl; // This prints &amp;quot;456&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, the object &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is a reference to &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. It differs from a pointer to &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; in that it is ''implicitly'' dereferenced at all future usage; &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is semantically indistinguishable from &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; after line 2. Furthermore, &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; can never be reassigned so that it refers to any variable other than &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Effectively, &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is an ''alias'' for &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the similarity to the corresponding C code using pointers demonstrates that references really are pointers that simply hide the fact that they have any independent existence as raw memory addresses.&lt;br /&gt;
&lt;br /&gt;
References are not by any means first class objects in C++. References to references, arrays of references, and pointers to references are not allowed.&lt;br /&gt;
&lt;br /&gt;
When a reference type is on a function's parameter list, ''pass by reference'' occurs. The reference parameter will be initialized when the function call is made, but, once within the body of the function, it will be semantically indistinguishable from the object from which it was initialized, and will go out of scope when the function returns. Changes made to the reference parameter will change the actual argument passed in. Thus:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
void bar(int&amp;amp; z)&lt;br /&gt;
{&lt;br /&gt;
    z = 456;&lt;br /&gt;
}&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
    int x = 123;&lt;br /&gt;
    bar(x);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; x &amp;lt;&amp;lt; std::endl; // This prints &amp;quot;456&amp;quot;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
On the other hand, if a variable of reference type is passed into a function, the effect will be the same as if the referent itself were passed into the function. &lt;br /&gt;
&lt;br /&gt;
References may be returned from functions, too. For example, the function &amp;lt;code&amp;gt;std::vector::operator[]&amp;lt;/code&amp;gt; returns a reference to the vector's &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt;. This is done so that we may write a statement such as &amp;lt;code&amp;gt;V[x] = y&amp;lt;/code&amp;gt; (where &amp;lt;code&amp;gt;V&amp;lt;/code&amp;gt; is a map). Because the value returned is from the vector's internal memory, this assignment statement will change the contents of the vector. If &amp;lt;code&amp;gt;operator[]&amp;lt;/code&amp;gt; returned simply &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt;, rather than &amp;lt;code&amp;gt;value_type&amp;amp;&amp;lt;/code&amp;gt;, then the return value would be a temporary copy of the value inside the vector, and it would not be an lvalue, so this assignment statement would not be valid, and, even if it were, it would have no hope of modifying the contents of the vector as desired.&lt;br /&gt;
&lt;br /&gt;
C++ references are not referred to as pointers, because this would lead to confusion with the actual pointer type &amp;lt;code&amp;gt;T*&amp;lt;/code&amp;gt;. The question of whether, in general, these objects should be considered pointers is more tricky. Yes, they contain address information about their referents, and yes, they may be used to access their referents in memory, but the fact that &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; are semantically indistinguishable after the initialization of &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; makes it logically dissatisfying to call &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; a pointer but not &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. However, as everyone agrees on the statement, &amp;quot;C++ has pointers&amp;quot;, this issue is not often discussed.&lt;br /&gt;
&lt;br /&gt;
====Pointers to member====&lt;br /&gt;
C++ also has ''pointers to data member''. The following example illustrates their usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
struct A&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
};&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    A a; a.x = 123;&lt;br /&gt;
    int A::*p = &amp;amp;A::x;&lt;br /&gt;
    a.*p = 456;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; a.x &amp;lt;&amp;lt; std::endl; // this prints &amp;quot;456&amp;quot;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The type &amp;lt;code&amp;gt;int A::*&amp;lt;/code&amp;gt; is a ''pointer to &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; member of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;''. It is used to point to some &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; ''field'' of the ''class'' (or struct) &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; (and not to an ''instance'' thereof). In line 9, we initialize this pointer so that it points to the member &amp;lt;code&amp;gt;A::x&amp;lt;/code&amp;gt;. However, this pointer does not actually refer to anything by itself; it only refers to a field within &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. In order to use this pointer, we must ''instantiate'' it by actually ''providing'' an instance of the struct &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. The value &amp;lt;code&amp;gt;a.*p&amp;lt;/code&amp;gt; points to &amp;lt;code&amp;gt;a.x&amp;lt;/code&amp;gt;, since &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; refers to the field &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; of some &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In some implementations of C++, the pointer &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; in this example actually contains the ''offset'' of the member &amp;lt;code&amp;gt;A::x&amp;lt;/code&amp;gt; from the beginning of the corresponding instance of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; in memory. In the example above, the numerical value of &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is probably actually zero, since &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is the first field of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. However, this is ''not'' a null pointer. In fact, it is not a fully ''qualified'' pointer at all. It may ''only'' be used in conjunction with an object of type &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. Arguably, since it does not contain enough information to refer to any specific value in memory, it should not be considered a true pointer at all. Yet, in C++ terminology, it is still a type of pointer, whereas the reference type discussed in the previous section is not!&lt;br /&gt;
&lt;br /&gt;
There are also pointers to member ''functions'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
struct A&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    virtual void f()&lt;br /&gt;
    {&lt;br /&gt;
        x = 123;&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
struct B : A&lt;br /&gt;
{&lt;br /&gt;
    void f()&lt;br /&gt;
    {&lt;br /&gt;
        x = 456;&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
    A a;&lt;br /&gt;
    B b;&lt;br /&gt;
    void (A::*p)(int) = &amp;amp;A::f;&lt;br /&gt;
    (a.*p)();&lt;br /&gt;
    (b.*p)();&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; a.x &amp;lt;&amp;lt; std::endl; // this prints &amp;quot;123&amp;quot;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; b.x &amp;lt;&amp;lt; std::endl; // this prints &amp;quot;456&amp;quot;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
These are more subtle than pointers to data members. The type &amp;lt;code&amp;gt;void (A::*)()&amp;lt;/code&amp;gt; is a ''pointer to member function of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; taking no arguments and returning &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;''. However, just as a pointer to data member is not a complete pointer capable of referring to a specific memory location, a pointer to member function does not completely specify the address of the function it points to, because of the possibility of ''inheritance''. In this example, because of polymorphism, the object &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;, which is of type &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, is ''also'' a valid object of type &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. The pointer &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; is required to be able to invoke the function &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; on any object of type &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. And yet &amp;lt;code&amp;gt;a.*p&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b.*p&amp;lt;/code&amp;gt; are ''different functions'' (that is, functions at different memory addresses), because &amp;lt;code&amp;gt;B::f&amp;lt;/code&amp;gt; overrides &amp;lt;code&amp;gt;A::f&amp;lt;/code&amp;gt;! This means &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; cannot store a simple address. Instead, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; probably points to the offset of the entry for &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; from the beginning of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;'s virtual method table; instantiating and invoking &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; then requires a lookup and a translation.&lt;br /&gt;
&lt;br /&gt;
====Iterators====&lt;br /&gt;
As C++ supports operator overloading, it is possible to define a type of object that behaves like a pointer syntactically, but doesn't have type &amp;lt;code&amp;gt;T*&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;set&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
    std::set&amp;lt;int&amp;gt; S;&lt;br /&gt;
    S.insert(123);&lt;br /&gt;
    std::set&amp;lt;int&amp;gt;::iterator I = S.find(123);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; *I &amp;lt;&amp;lt; std::endl; // this prints &amp;quot;123&amp;quot;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this code, the object &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; is called an ''iterator''. The &amp;lt;code&amp;gt;std::set&amp;lt;&amp;gt;::find&amp;lt;/code&amp;gt; function returns an iterator, which is like a pointer to one of the set's elements. After this initialization of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, the expression &amp;lt;code&amp;gt;*I&amp;lt;/code&amp;gt; may be used to dereference the iterator. As it points to the element of value 123 found within the set, &amp;lt;code&amp;gt;*I&amp;lt;/code&amp;gt; equals 123.&lt;br /&gt;
&lt;br /&gt;
An iterator must, at the very least, define &amp;lt;code&amp;gt;operator*&amp;lt;/code&amp;gt;, so that it may be dereferenced using the same syntax as an ordinary pointer.&lt;br /&gt;
&lt;br /&gt;
It is arguable whether an iterator can be considered a pointer. Iterators do provide access to their referents, but they are not required to contain their referents' memory addresses; they just need to store enough information to unambiguously determine their referents' addresses. Iterators are usually implemented as classes containing a private pointer member to their referents, but this is not a requirement. On the other hand, C pointers are also not required to contain raw memory addresses, even though they usually do; this suggests that iterators ought to be considered pointers just as much as &amp;quot;true&amp;quot; C pointers. The fact that iterators in C++ are generally considered more general objects than pointers, however, suggests that the term ''pointer'' should perhaps be best understood in the context of individual languages.&lt;br /&gt;
&lt;br /&gt;
===Java, C#, Python, Ruby, ''etc.''===&lt;br /&gt;
There is some controversy over the question of whether Java has pointers. Here is an example to illustrate the source of this confusion:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
class Foo {&lt;br /&gt;
        int bar;&lt;br /&gt;
        Foo(int x) {&lt;br /&gt;
                bar = x;&lt;br /&gt;
        }&lt;br /&gt;
        int getBar() {&lt;br /&gt;
                return bar;&lt;br /&gt;
        }&lt;br /&gt;
        void setBar(int x) {&lt;br /&gt;
                bar = x;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class Example {&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
                Foo f = new Foo(123);&lt;br /&gt;
                Foo g = f;&lt;br /&gt;
                g.setBar(456);&lt;br /&gt;
                System.out.println(f.getBar()); // This prints &amp;quot;456&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It is clear from this example that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are not value ''instances'' of the class &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;; if they were, then the statement &amp;lt;code&amp;gt;g = f;&amp;lt;/code&amp;gt; would create a copy of &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. Instead, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are like pointers with an anonymous referent constructed by the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; invocation, so that after &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is assigned to &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, the two pointers will have the same referent. On the other hand, in semantics, &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are more like C++ references; it would not make sense to use &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; operators because these Java pointers do not exist independently of their referents; only one or the other is exposed in the language proper. (Primitive types such as &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; cannot be referred to with pointers, and they cannot be passed by reference.)&lt;br /&gt;
&lt;br /&gt;
One can also argue about whether Java passes parameters by value or by reference. If we insist that Java passes all parameters by value, then we must accept that &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; have pointer nature, because if &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is passed into a function, and the parameter that receives it is reassigned via the assignment operator, then &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is unchanged, but if a method is called on the parameter that mutates a data member of &amp;lt;code&amp;gt;Foo&amp;lt;/code&amp;gt;, then those changes will be reflected in &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;, which is just what we would expect if a C++ pointer were passed (and the method called with the &amp;lt;code&amp;gt;-&amp;gt;&amp;lt;/code&amp;gt; operator). However, the lack of independent existence of pointers and their referents is taken by some to imply that Java cannot really said to possess pointers. Thus, there is considerable controversy over the question of whether Java has pointers.&lt;br /&gt;
&lt;br /&gt;
The names &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;, at any rate, probably do not refer to fixed memory addresses; this stands in contrast to C, where pointers probably ''do'' refer to fixed memory addresses (but this is not required by the standard). This is because Java's automatic memory management is allowed to move values around in memory, and &amp;quot;pointers&amp;quot; must therefore be defined in a way that allows them to follow this movement.&lt;br /&gt;
&amp;lt;!-- TODO: Talk about Lisp, Scheme, Haskell, ML, and Perl --&amp;gt;&lt;br /&gt;
===Disk (and other) pointers===&lt;br /&gt;
File systems that organize data on disks also use pointers to keep track of where on the disk files are located; however, these are typically specialized data structures handled by an operating system kernel, and do not appear in application programs or in mainstream programming languages. These ''disk pointers'' are usually referred to as such to distinguish them from pointers into primary storage and virtual memory, which are simply called ''pointers''. &lt;br /&gt;
&lt;br /&gt;
The term ''memory'' can, in general, refer not only to primary storage, disks, and virtual memory, but also to CPU registers, cache, and other machines (as in a network cluster). Nevertheless, the term ''pointer'' is very rarely used to describe objects that address these other forms of memory. For example, an IP address is not referred to as a pointer.&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>