Java Inner-Class direclty implemented with Parameter Constructor?
<p>normally I implement my Runnables as follows (directly implemented inner class):</p>

<pre><code>Runnable updateRunnable = new Runnable() {

    public void run() { 
    }
}
</code></pre>

<p>Is there any working way in Java to implement the Class by passing any parameters in the constructor as follows?</p>

<pre><code>Runnable updateRunnable = new Runnable(locale) {

    Locale locale = null;

    public Runnable(Locale locale){
        this.locale = locale
    }

    public void run() { 
    }
};
</code></pre>

<p>==>My goal is to have an directly implemented inner class but I want to pass in a parameter. </p>

<p>Whats the best solution to do this (the example above seems to not be working????) Is the only possibility to work with getter setters or alternatively implement the class as an "normal" inner class (that is not direclty implemented).</p>

<p>thank you very much!
jan</p>
