URL variable "contains" string but should contain reference to URL instance
<p>The following statement creates an instance of the URL class, fills it in the "url" variable and fills the first argument (http://www.stackoverflow.com) into a non-static attribute:</p>

<pre><code>URL url = new URL("http://www.stackoverflow.com");
</code></pre>

<p>How come it's possible to get the attribute value with the following statement, when you really should point at a get-method to get the attribute and not directly at the instance reference?:</p>

<p>1 What is possible but (Maybe) shouldn't be:</p>

<pre><code>String urlstr = url.toString();
</code></pre>

<p>2 How it really should be:</p>

<pre><code>String urlstr = url.getUrl();
</code></pre>
