Home / CSE MCQs / JAVA MCQs :: Threads - Java

CSE MCQs :: JAVA MCQs

  1. Which of these method can be used to make the main thread to be executed last among all the threads?
  2. A.
    stop()
    B.
    sleep()
    C.
    join()
    D.
    call()

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of these method is used to find out that a thread is still running or not?
  4. A.
    run()
    B.
    Alive()
    C.
    isAlive()
    D.
    checkRun()

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. What is the default value of priority variable MIN_PRIORITY AND MAX_PRIORITY?
  6. A.
    0 & 256
    B.
    0 & 1
    C.
    1 & 10
    D.
    1 & 256

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of these method waits for the thread to treminate?
  8. A.
    sleep()
    B.
    isAlive()
    C.
    join()
    D.
    stop()

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which of these method is used to explicitly set the priority of a thread?
  10. A.
    set()
    B.
    make()
    C.
    setPriority()
    D.
    makePriority()

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. What is synchronization in reference to a thread?
  12. A.
    It's a process of handling situations when two or more threads need access to a shared resource.
    B.
    Its a process by which many thread are able to access same shared resource simultaneously.
    C.
    Its a process by which a method is able to access many different threads simultaneously.
    D.
    Its a method that allow to many threads to access any information require.

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Which of these method is used to implement Runnable interface?
  14. A.
    stop()
    B.
    run()
    C.
    runThread()
    D.
    stopThread()

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Which of these interface is implemented by Thread class?
  16. A.
    Runnable
    B.
    Connections
    C.
    Set
    D.
    MapConnections

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Which of these method is used to begin the execution of a thread?
  18. A.
    run()
    B.
    start()
    C.
    runThread()
    D.
    startThread()

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Which of these method waits for the thread to treminate?
  20. A.
    sleep()
    B.
    isAlive()
    C.
    join()
    D.
    stop()

    View Answer

    Workspace

    Discuss Discuss in Forum