Java Hashtable question
<p>My code returns entrySet() as expected if called from within its own class. However if i call it via  a getter method in Main it returns an empty table. Why?</p>

<pre><code>class Results
{
    Hashtable&lt;String, Double&gt; langScores ;

    public Results()
    {
        langScores = new Hashtable&lt;String, Double&gt;() ;
    }

    public void addScores(double pL1, double pL2, double pL3)
    {
        langScores.put("English", pL1 ) ;
        langScores.put("French", pL2 ) ;
        langScores.put("German", pL3 ) ;
        System.out.println(langScores.entrySet()) ;
    }

    public Set&lt;Map.Entry&lt;String, Double&gt;&gt; getWinner()
    {
        return langScores.entrySet() ;
    }
}
</code></pre>

<p>MAIN:</p>

<pre><code>class LanguageIdentifier 
{
    public static void main(String[] args) 
    {
        Results winner = new Results() ;

        AnalyseText analyse = new AnalyseText() ; //addScores called from this class

        analyse.analyseText() ;
        System.out.println(winner.getWinner()) ;
    }
}
</code></pre>

<p>OUTPUT</p>

<pre><code>[German=0.0040, French=0.0030, English=0.02] // print statement within Results class works

[] // print statement within Main class prints empty table !?
</code></pre>
