Basic Java Multi Threading Examples
-
ThreadCreation.java: Different ways to create threads in java: a) Extending the thread class b) Implementing runnable interface
-
ThreadExample.java: In this class, i have covered example to show order of thread executions.
-
SynchronizationDemo.java: In this class have created thread by extending thread class and accessed same increment method by 2 threads but have used syncronized keyword to use shared resource.
-
SynchronizationDemo2.java: In this class have created thread by implementing runnable interface and accessed same increment method by 2 threads but have used syncronized keyword to use shared resource.
-
InterThreadCommunication.java In this class, two threads are communicating with each other using wait and notify.
-
EvenOdd.java In this class, two threads are printing even and odd numbers alternatively using inter thread commnunication.