Become a GOLD member of Deccansoft and get access to 40+ courses!!
NewBatches/Webinars
Packages
Gold Membership
Bestseller
Microsoft Azure Suite & Suite Plus
Power Platform Acadamy
New
Azure DevOps Expert & Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Courses
MS.NET Courses (Includes Live Project)
Complete C#, OOPs and Windows Programing
ASP.NET MVC Online Training
ASP.NET WebForms
ASP.NET Core
WCF incl. Web Services and Remoting
WPF incl. MVVM and Prism
LINQ and Entity Framework
Live Project Training for Developing Enterprise Application
Live Project using Ntier Arch (.NET5 + EF Core + Angular)
Microservices using .NET Core
Gold Membership
CareerStep IT Program
Client-side UI Technologies
Building Static Web Pages using HTML and CSS
JavaScript and HTML DOM
jQuery, AJAX and JSON
Building Interactive Web Pages using HTML5 and CSS3
BootStrap + Live Examples
AngularJS + Live Project
Angular + Typescript
ReactJS
KnockoutJS
Xamarin
SQL Server + MSBI
SQL Server 2017
Querying Data with Transact-SQL(70-761)
SQL Server Integration Service (SSIS)
SQL Server Reporting Service (SSRS)
SQL Service Analysis Service (SSAS)
Cloud Computing / Azure / AWS
AZ-900: Microsoft Azure Fundamentals
Azure Suite (AZ-104+AZ-204+AZ-305+ AZ-500)
AZ-104: Microsoft Azure Administrator
AZ-204: Developing Solutions for Microsoft Azure
AZ-305: Microsoft Azure Architect Technologies and Design
DP-203: Data Engineering on Microsoft Azure
Amazon Web Services (AWS)
DevOps Expert
AZ-400: Microsoft Azure DevOps
Docker by Sandeep Soni
Kubernetes by Sandeep Soni
Docker & Kubernetes by Rahul Rampurkar
IaC Using Terraform
Powershell
Microsoft Power Platform
Microsoft Power Platform
Data Analytics using PowerBI (DA-100)
Testing Tools
Manual Testing
Selenium Testing with Java(Live Training)
Others
Python Programming
C and Data Structure
Core Java
OOPs and C++
Advance Java
Complete Azure Training
Pricing
Videos
Testimonials
Azure Certification
Contact Us
Login
Login or Register
×
Sign In
Register
Forgot Password?
How did you find us
WhatsApp
YouTube
LinkedIn
Facebook
Telegram
Twitter
Google
Referred by Friend
Refresh
Input symbols
By clicking Register, you accept to the
terms and conditions
and that you have read our
privacy policy.
Recover Password
×
Submit
Enquiry Now
Where did you come to know about us
WhatsApp
YouTube
LinkedIn
Facebook
LinkedIn Ad
Email
Twitter
Google
Referred
Other
Refresh
Input symbols
Multi Threaded Programming
Interview Questions and Answer
1. 1. Which of these method is used to implement Runnable interface?
Options:
a. stop()
b. run()
c. runThread()
d. stopThread()
Reveal Answer
2. 2. Which of these interface is implemented by Thread class?
Options:
a. Runnable
b. Connections
c. Set
d. MapConnections
Reveal Answer
3. 3 Which of these method is used to begin the execution of a thread?
Options:
a. run()
b. start()
c. runThread()
d. startThread()
Reveal Answer
4. 4. Which of these method waits for the thread to treminate?
Options:
a. sleep()
b. isAlive()
c. join()
d. stop()
Reveal Answer
5. 5. Which of these statement is incorrect?
Options:
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
d. run() method is used to begin execution of a thread before start() method in special cases.
Reveal Answer
6. 6. What is the output of this program? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } public void run() { System.out.println(t.getName()); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Options:
a. My Thread
b. Thread[My Thread,5,main]
c. Compilation Error
d. Runtime Error
Reveal Answer
7. 7. What is the output of this program? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } public void run() { System.out.println(t); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Options:
a. My Thread
b. Thread[My Thread,5,main]
c. Compilation Error
d. Runtime Error
Reveal Answer
8. 8. What is the output of this program? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Options:
a. My Thread
b. Thread[My Thread,5,main]
c. Compilation Error
d. Runtime Error
Reveal Answer
9. 9. What is the output of this program? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"New Thread"); t.start(); } public void run() { t.setPriority(Thread.MAX_PRIORITY); System.out.println(t); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Options:
a. Thread[New Thread,0,main]
b. Thread[New Thread,1,main]
c. Thread[New Thread,5,main]
d. Thread[New Thread,10,main]
Reveal Answer
10. 10. What is the output of this program? class newthread implements Runnable { Thread t; newthread() { t1 = new Thread(this,"Thread_1"); t2 = new Thread(this,"Thread_2"); t1.start(); t2.start(); } public void run() { t2.setPriority(Thread.MAX_PRIORITY); System.out.print(t1.equals(t2)); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Options:
a. true
b. false
c. truetrue
d. falsefalse
Reveal Answer
11. 11. Which of these method can be used to make the main thread to be executed last among all the threads?
Options:
a. A. stop()
b. sleep()
c. join()
d. call()
Reveal Answer
12. 12. Which of these method is used to find out that a thread is still running or not?
Options:
a. run()
b. Alive()
c. isAlive()
d. checkRun()
Reveal Answer
13. 13. What is the default value of priority variable MIN_PRIORITY AND MAX_PRIORITY?
Options:
a. 0 & 256
b. 0 & 1
c. 1 & 10
d. 1 & 256
Reveal Answer
14. 14. Which of these method waits for the thread to treminate?
Options:
a. sleep()
b. isAlive()
c. join()
d. stop()
Reveal Answer
15. 15. Which of these method is used to explicitly set the priority of a thread?
Options:
a. set()
b. make()
c. setPriority()
d. makePriority()
Reveal Answer
16. 16. What is synchronization in reference to a thread?
Options:
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.
Reveal Answer
17. 17. Which of these method is used to implement Runnable interface?
Options:
a. stop()
b. run()
c. runThread()
d. stopThread()
Reveal Answer
18. 18. Which of these interface is implemented by Thread class?
Options:
a. Runnable
b. Connections
c. Set
d. MapConnections
Reveal Answer
19. 19. Which of these method is used to begin the execution of a thread?
Options:
a. run()
b. start()
c. runThread()
d. startThread()
Reveal Answer
20. 20. Which of these method waits for the thread to treminate?
Options:
a. sleep()
b. isAlive()
c. join()
d. stop()
Reveal Answer
21. 21. Which of these statement is incorrect?
Options:
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.
Reveal Answer
22. 22. Which of these class is used to make a thread?
Options:
a. String
b. System
c. Thread
d. Runnable
Reveal Answer
23. 23. Which of these interface is implemented by Thread class?
Options:
a. Runnable
b. Connections
c. Set
d. MapConnections
Reveal Answer
24. 24. Which of these method of Thread class is used to find out the priority given to a thread?
Options:
a. get()
b. ThreadPriority()
c. getPriority()
d. getThreadPriority()
Reveal Answer
25. 25. Which of these method of Thread class is used to Suspend a thread for a period of time?
Options:
a. sleep()
b. terminate()
c. suspend()
d. stop()
Reveal Answer
26. 26. Which function of pre defined class Thread is used to check weather current thread being checked is still running?
Options:
a. isAlive()
b. Join()
c. isRunning()
d. Alive()
Reveal Answer
27. 27. What is multithreaded programming?
Options:
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.
Reveal Answer
28. 28. Which of these are types of multitasking?
Options:
a. Process based
b. Thread based
c. Process and Thread based
d. None of the mentioned
Reveal Answer
29. 29. Which of these packages contain all the Java’s built in exceptions?
Options:
a. java.io
b. java.util
c. java.lang
d. java.net
Reveal Answer
30. 30. Thread priority in Java is?
Options:
a. Integer
b. Float
c. double
d. long
Reveal Answer
31. 31. What will happen if two thread of same priority are called to be processed simultaneously?
Options:
a. Any one will be executed first lexographically
b. Both of them will be executed simultaneously
c. None of them will be executed
d. It is dependent on the operating system.
Reveal Answer
32. 32. Which of these statements is incorrect?
Options:
a. By multithreading CPU’s idle time is minimized, and we can take maximum use of it.
b. By multitasking CPU’s idle time is minimized, and we can take maximum use of it.
c. C. Two thread in Java can have same priority
d. A thread can exist only in two states, running and blocked.
Reveal Answer
Packages
Gold Membership
Microsoft Azure Suite &Suite Plus
Azure DevOps Expert &Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Resources
Blog
Deccansoft
AzureA2Z
Wall of Fame
On-Job Tech Support
About
About BestDotNetTraining
About Trainer
Testimonials
FAQ
Other links
About Us
Contact Us
Leave us a feedback
Sitemap
Privacy Policy
Terms & Conditions
Proudly Powered by