<p>Simple question, but one that I've been curious about...is there a functional difference between the following two commands?</p>

<pre><code>String::class
String.class
</code></pre>

<p>They both do what I expect -- that is to say they return <code>Class</code> -- but what is the difference between using the <code>::</code> and the <code>.</code>?</p>

<p>I notice that on those classes that have constants defined, IRB's auto-completion will return the constants as available options when you press tab after <code>::</code> but not after <code>.</code>, but I don't know what the reason for this is...</p>

The
```
.
```
operator basically says "send this message to the object". In your example it is calling that particular member. The
```
::
```
operator "drills down" to the scope defined to the left of the operator, and then calls the member defined on the right side of operator.
When you use
```
::
```
you have to be referencing members that are defined. When using
```
.
```
you are simply sending a message to the object. Because that message could be anything, auto-completion does not work for
```
.
```
while it does for
```
::
```
.