KPax
asked on
Why method in Java which is called from Runnable run() doesn't need to be 'static'?
Why this compiles, even if fooBar is NOT static?
public class TestClass implements Runnable {
public static void main(String[] args) {
// TestClass tc = new TestClass();
}
@Override
public void run() {
fooBar();
}
private void fooBar() {
System.out.println("fooBar");
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.