Invoking methods on objects in java
<p>Here's the relevant part of the Dice class:</p>

<pre><code>import java.util.*;
class Dice 
{ 
    String name ; 
    int x ; 
    int[] sum ; 
</code></pre>

<p>...</p>

<pre><code>public Dice (String name) 
    { 
        this.name = name ; 
        this.x = 0 ; 
        this.sum = new int[7] ; 
    }
</code></pre>

<p>...</p>

<pre><code>public void roll () 
    {
        this.x = randNum(1, this.sum.length) ; 
        this.sum[x] ++ ;
    }
</code></pre>

<p>I am invoking this method in a separate class named <code>Risk</code>    </p>

<pre><code>class Risk 
{
</code></pre>

<p>Heres the first line of the method: </p>

<pre><code>public static void IdiceRoll (Dice o)
</code></pre>

<p>So this method takes a dice that already exists as a paramater so theres no need to create a new dice inside it. </p>

<p>Finaly here is how i'm trying to invoke <code>roll</code> on <code>o</code>: </p>

<pre><code>o.Dice.roll () ; 
</code></pre>
