Posts

Showing posts with the label multithreading

Threads interview questions and answers in java

In this page we will come to know most of the threads interview questions and answers. If any one has faced any of the other questions which is not mentioned in the current page. Please share with me through "Contact me here" gadget which is present in end of the page or drop me an email to " admin@javatbrains.com ".   Q1: How many ways you can create a Thread? A: Mainly two ways we can create Thread class. Extending Thread class implementing Runnable Interface Q2: Can you e xplain about these two ways to create a Thread? A: The first method of creating a thread class is to simply extend from the Thread class. This should be done if the class does not ever need to be extended from another class.               import java.lang.*;               public class Count extends Thread{                      public void run(){                             .....                      }               }         The above example creates anew class Count that ext