threads are lightweight versions of process. they share the memory with other
threads within the process and executes concurrently.. In a single
process machine it seems that it is executing normally but actually they are in
sequential. the order in which threads come into execution are determined by
the Operating System in which the JVM runs
you can override wait() and Notify() functions in java.lang.Thread class and
synchronized identifier can also used for Synchronization of process
hope this will solve your problem if not please contact me with more details