Java thread MCQ

Programming Language > Java Programming Language

Evaluate your understanding of Java threads with these multiple choice questions. Learn about the different methods for creating and managing threads in Java and how to use them to build efficient and responsive Java programs. Take the quiz now! ➲ Java thread MCQ - Quiz


  • A Thread(Runnable threadOb, int priority)
  • B Thread(int priority)
  • C Thread(Runnable threadOb, String threadName)
  • D Thread(String threadName, int priority)
  • A Extending the thread class.
  • B Implementing Runnable interface.
  • C Both of the above
  • D None of these
  • A The program does not compile because this cannot be referenced in a static method.
  • B The program compiles fine, but it does not print anything because t does not invoke the run() method
  • C The program compiles and runs fine and displays test on the console.
  • D None of the above
  • A The program will not compile because it does not implement the run() method.
  • B The program will not compile because it does not contain abstract methods.
  • C The program compiles fine.
  • D None of the above
  • A The program has a compilation error because t is defined in both the main() method and the constructor Test().
  • B The program compiles fine, but it does not run because you cannot use the keyword this in the constructor.
  • C The program compiles and runs and displays nothing.
  • D The program compiles and runs and displays test.
  • A The program does not compile because the start() method is not defined in the Test class.
  • B The program compiles, but it does not run because the start() method is not defined.
  • C The program compiles, but it does not run because the run() method is not implemented.
  • D The program compiles and runs fine.
  • A 1 , 2 and 4
  • B 1 and 3
  • C 3 only
  • D None of the above
  • A Wakes up one threads that are waiting on this object's monitor
  • B Wakes up all threads that are not waiting on this object's monitor
  • C Wakes up all threads that are waiting on this object's monitor
  • D None of the above
  • A A compile time error indicating that no run method is defined for the Thread class
  • B A run time error indicating that no run method is defined for the Thread class
  • C Clean compile and at run time the values 0 to 9 are printed out
  • D Clean compile but no output at runtime