## Java Programming : Java Multithreading

Java Multithreading Interview Questions and Answers for freshers as well as experienced. Multithreading MCQ questions can be helpful to crack java Interview in various companies.
1. Which of these class is used to make a thread?
[A] String
[B] System
[D] Runnable

Explanation:

2. Which of these interface is implemented by Thread class?
[A] Runnable
[B] Connections
[C] Set
[D] MapConnections

Explanation:

Runnable interface used by Thread class
3. Which function of pre defined class Thread is used to check weather current thread being checked is still running?
[A] isAlive()
[B] Join()
[C] isRunning()
[D] Alive()

Explanation:

isAlive() function is defined in class Thread, it is used for implementing multithreading and to check whether the thread called upon is still running or not.
4. What is the output of this program?

public static void main(String args[]) {
System.out.println(t);
}
}


Explanation:

5. What is the priority of the thread in output of this program?

public static void main(String args[]) {
System.out.println(t.getName());
}
}

[A] main

Explanation:

The getName() function is used to obtain the name of the thread, in this code the name given to thread is â€˜New Threadâ€™.
6. What is the name of the thread in output of this program?

public static void main(String args[]) {
System.out.println(t.getPriority());
}
}

[A] 0
[B] 1
[C] 4
[D] 5

Explanation:

The default priority given to a thread is 5.
[A] Asynchronized methods
[B] Synchronized methods
[C] Serialized methods
[D] None of above

Explanation:

Synchronized methods is used for multiprogramming
8. Which of the following is used to force each thread to reconcile its working copy of a variable with the master copy in main memory?
[A] synchronized
[B] transient
[C] volatile
[D] native

Explanation:

A field might be shared between two or more threads. Each thread is allowed to maintain a working copy of the field. If the threads do not reconcile the working copies then each might be working with a different value.
[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.

Answer: B. Itâ€™s a process in which two or more parts of same process run simultaneously.

Explanation:

multithreaded programming a process in which two or more parts of same process run simultaneously.
10. Which of these are types of multitasking?
[A] Process based
[D] None of the mentioned

Explanation: