How do you properly return variables
<p>I am trying to learn Java and am playing around with variables as well as jaunt for a basic program I have in mind. My goal is to use the use the main method to print out the data I collect in my other methods. I am sure the answer is blindingly obvious and I have read the Java docs, but am still confused as to why this is not working. When I run the program it seems to run without printing the data I want. Furthermore, if I add a sysout statement to the spfivehundred method than it shows the spfivehundred method looping infinitly and printing the data I want to come out of the main method. </p>

<pre><code>import com.jaunt.*;
import com.jaunt.component.*;

public class mainthread {

    public static void main(String[] args) {
        spfivehundred();
        double spfivehundreded = spfivehundred();
        System.out.println(spfivehundreded);
    }

    public static double spfivehundred() {
        UserAgent userAgent = new UserAgent();

        try {
            userAgent.visit("http://www.investing.com/indices/us-spx-500");
            String spfivehundredget = userAgent.doc.findFirst(
                    "&lt;span class=\"arial_26 inlineblock pid-166-last\"&gt;")
                    .getText();
            double spfivehundred = Double.parseDouble(spfivehundredget.replace(
                    ",", ""));

        } catch (JauntException e) {

            System.err.println(e);
        }
        return spfivehundred();

    }

}
</code></pre>