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

CSE MCQs :: JAVA MCQs

  1. Which of these statement is incorrect?
  2. A.
    A thread can be formed by implementing Runnable interface only.
    B.
    A thread can be formed by a class that extends Thread class.
    C.
    start() method is used to begin execution of the thread.
    D.
    run() method is used to begin execution of a thread before start() method in special cases.

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of these class is used to make a thread?
  4. A.
    String
    B.
    System
    C.
    Thread
    D.
    Runnable

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of these method of Thread class is used to find out the priority given to a thread?
  8. A.
    get()
    B.
    ThreadPriority()
    C.
    getPriority()
    D.
    getThreadPriority()

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which of these method of Thread class is used to Suspend a thread for a period of time?
  10. A.
    sleep()
    B.
    terminate()
    C.
    suspend()
    D.
    stop()

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which function of pre defined class Thread is used to check weather current thread being checked is still running?
  12. A.
    isAlive()
    B.
    Join()
    C.
    isRunning()
    D.
    Alive()

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. What is multithreaded programming?
  14. A.
    It's a process in which two different processes run simultaneously.
    B.
    It's a process in which two or more parts of same process run simultaneously.
    C.
    Its a process in which many different process are able to access same information.
    D.
    Its a process in which a single process can access information from many sources.

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Which of these are types of multitasking?
  16. A.
    Process based
    B.
    Thread based
    C.
    Process and Thread based
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Which of these packages contain all the Java's built in exceptions?
  18. A.
    java.io
    B.
    java.util
    C.
    java.lang
    D.
    java.net

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Thread priority in Java is?
  20. A.
    Integer
    B.
    Float
    C.
    double
    D.
    long

    View Answer

    Workspace

    Discuss Discuss in Forum