Java - Sending value to other object
<p>I have a code like this:</p>

<pre><code>    public class Freq{

    void add{
    //code 
    //code
    ...
    //code

    public void find{
    //some whileloop
    ...
    //code
    //code 
    if (some calculation){
    //calculation
    theMode = something
    elseif (other calculation){
    theMode = something else
    else theMode = another thing

    public void printValuesAndCount(){
    //printings
    //WHAT I WANT TO DO BUT CANNOT: System.out.println(theMode);

    public static void main(String[] args){
    //initialising things

    Freq keeper = new Freq();

    //some for-loop
    keeper.printValuesAndCount();
</code></pre>

<p>I seem to not be able to pass the value "theMode" to my printValuesAndCount().
I know that void means you dont return something, but I have tried to modify my "find" as much as I can without succes. Any help appreciated,</p>
