Java multithreading examples including two ways of multithreading, good examples, avoiding deadlock, and how many threads can run.