Multithreading using Thread and Runnable in Java
In Java to create a thread, we can extend the Thread class or implement a Runnable interface. To get purchase transactions we will create a class that extends the Thread class. This class will have a constructor which accepts an id of a customer as a parameter. Then we have to override the run method of a Thread class