Java - Returning strings
<p>I wish to return a string from a method object that is called by another method in another class.  My problem is: when I attempt to assign the returned value to a String in the other class, it cannot find the method object within the class object.</p>

<pre><code>Guessing Game = new Guessing();
</code></pre>

<p>This makes the object using the class Guessing.Java</p>

<pre><code>else if (buttonObj == guess){
        double g = yourGuess.getNumber();
            if ((g &gt; 0)&amp;&amp;(g &lt; 11)){
                Game.StartGame(g);
                label3.setVisible(false);
                yourGuess.setEnabled(false);
                label1.setText(Game.StartGame());
            }else{
                label3.setVisible(true);
                yourGuess.requestFocus(true);
            }
    }
</code></pre>

<p>When I try retrieving the String from the StartGame method within the Guessing.Java class, it says it cannot find the class.</p>

<pre><code>public String StartGame(double guess){
    int round = 1;
    int guesses = 3;
    String correct = "correct";
    if (guesses &gt; 0){
        if (guess == ans){
            correct = "correct";
        }else if ((guess == ans - 1)||(guess == ans + 1)){
            correct = "hot";
            guesses--;
        }else if ((guess == ans - 2)||(guess == ans - 2)){
            correct = "warm";
            guesses--;
        }else{
            correct = "cold";
            guesses--;
        }
    }else{
        correct = "round";
    }
    return correct;        
}
</code></pre>

<p>I have tried several different things and looked it up multiple times but nothing works, can anyone help?</p>
