i have seen so many examples in which we called wait() and notify() method directly like below.
class ThreadB extends Thread{
int total;
@Override
public void run(){
synchronized(this){
for(int i=0; i<100 ; i++){
total += i;
}
notify();
}
}
}
but in the object class, method signature of notify is defined as
public final void notify()
Can someone please explain how we can call these method directly without using an object as these methods are not defined as static.
this.