Java Multithreading Questions and Answers

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
[C] Thread
[D] Runnable
Loading...
2. Which of these interface is implemented by Thread class?
[A] Runnable
[B] Connections
[C] Set
[D] MapConnections
Loading...
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()
Loading...
4. What is the output of this program?

class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
t.setName("New Thread");
System.out.println(t);
}
}
[A] Thread[5,main]
[B] Thread[New Thread,5]
[C] Thread[main,5,main]
[D] Thread[New Thread,5,main]
Loading...
5. What is the priority of the thread in output of this program?

class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
t.setName("New Thread");
System.out.println(t.getName());
}
}

[A] main
[B] Thread
[C] New Thread
[D] Thread[New Thread,5,main]
Loading...
6. What is the name of the thread in output of this program?

class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t.getPriority());
}
}
[A] 0
[B] 1
[C] 4
[D] 5
Loading...
7. Which methods are utilized to control the access to an object in multi threaded programming

[A] Asynchronized methods
[B] Synchronized methods
[C] Serialized methods
[D] None of above
Loading...
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
Loading...
9. What is multithreaded programming?
[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.
Loading...
10. Which of these are types of multitasking?
[A] Process based
[B] Thread based
[C] Process and Thread based
[D] None of the mentioned
Loading...

Are these questions helpful for you?



Comments: (Your feedback is valuable to us)