public class FirstClass
{
private FirstClass()
{
new Thread(new Thread()).start();
}
public static void checkSomething(FirstClass clas)
{
//doing something
}
private class Thread implements Runnable
{
@Override
public void run() {
checkSomething(????);
}
}
public static void main(String[] args)
{
new FirstClass();
}
}
my question is, what to write in ???? to get class FirstClass, i cannot write "this", coz i would get Thread.
You can write FirstClass.this to access the enclosing class instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With