Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java threads interview questions and answers

Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
Which of the following is true about Java threads?
  1. Low priority threads will execute only after high priority finishes execution
  2. CPU time is distributed to the threads according to thread priority.
  3. Operating System decides which thread to run when and for how much time.
  4. Threads in Java are not System dependent
Show Answer
Share Facebook gmail Twitter
6
Which exceptions are NOT associated with threads?
  1. InterruptedException
  2. IllegalMonitorStateException
  3. IllegalThreadStateException
  4. IllegalAccessException
Show Answer
Share Facebook gmail Twitter
7
Which methods gives the current thread's name?
  1. Thread.getName()
  2. Thread.name
  3. Thread.currentThread().getName());
  4. this.getName()
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
10
When will a thread die?
  1. Threads do not die
  2. A thread dies when execution of main() method is over
  3. A thread dies when execution of run() method is over
  4. You can kill a thread by using kill() method
Show Answer
Share Facebook gmail Twitter
11
What will be the output if we compile and run the program:
public class MyClass extends Thread {
 public MyClass(String s){ msg = s;}
 String msg;
 public void run(){
  System.out.print(msg);
 }
 public static void main(String[] args){
  new MyClass("Skillgun ");
  new MyClass("Technologies ");
  new MyClass("Welcomes You");
 }
}
  1. Compilation Error
  2. The program compiles and Prints Skillgun Technolgies Welcomes You
  3. The program compiles and prints continuosuly Skillgun Technologies Welcomes you
  4. The program compiles and terminate with out printing anything
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :