how do you make a class wait for a thred to have run for a certan amount of time
so i whant to
wait for thread to get to line 500
do somthing whith thread;
Actually, I think this is a good question, since it's a real-life one that often isnt answered by the books (because they're too academic). Although the best answer would be "use co-routines", since those aren't natively in java lets not go there
The correct way would be to use Object.wait() and Object.notify() (that's enough for you to google - but the simple explanation is you pick *any* object that is accessible to both your main class and to the thread, and when you want the class to start waiting you call (the object).wait(), and when the thread reaches line 500 you have it call (the object).notify().
Java lets you use any object for htis, soyou can have an infinite number of wait / notify pairs running in tandem at any one time. For example, you might create a String with the value "wait for thread to reach line 500" and use that as your object.