AmbitionBox
Discover Best Places to work in India
Discover best places to work
Compare & find best workplace
Bring your workplace to life
Highlight your company's perks
Read reviews for 6L+ companies
Rate your former or current company
Discover salaries for 8L+ companies
Calculate your take home salary
Check your market value
Help other jobseekers
Read interviews for 90K+ companies
Interviews questions for 1K+ colleges
Contribute your interview questions
Java Programming
What will happen if two thread of same priority are called to be processed simultaneously?
Any one will be executed first lexographically
Both of them will be executed simultaneously
None of them will be executed
It is dependent on the operating system.
What is the priority of the thread in output of this program?
classmultithreaded_programing{ publicstaticvoidmain(String args[]){ Thread t = Thread.currentThread(); System.out.println(t); } }
4
5
0
1
What is the name of the thread in output of this program?
main
thread
system
None of these
What is the name of the method used to start a thread execution?
init()
start()
run()
resume()
In java a thread can be created by ?
Extending the thread class.
Implementing Runnable interface.
Both of the above
C is the correct answer.
What will be the output of the following program code?
public class Test implements Runnable{public static void main(String[] args){ Thread t = new Thread(this); t.start(); }public void run(){ System.out.println("test"); } }
The program does not compile because this cannot be referenced in a static method.
The program compiles fine, but it does not print anything because it does not invoke the run() method.
The program compiles and runs fine and displays test on the console.
A is the correct answer.
When a class extends the Thread class ,it should override which method of Thread class to start that thread ?
B is the correct answer.
Which method in thread class causes the currently executing thread object to temporarily pause and allow other threads to execute?
public boolean isAlive()
public int getId()
public void yield()
public boolean isDaemon()
Answer:C
In how many states Threads can be explained ?
3
2
Answer:B
Which method is used to perform interthread communications?
A. yield ( )
B. sleep (..)
C. notify ( )
D. wait ( )
Join India’s largest community to research company culture
Are you a student or working professional?
Student/Never worked
I am a student/I have never worked
Working Professional
I am working/I have worked before
What are your preferred job locations?
Popular Cities
Other Cities
Follow your preferred designations/job profiles
Suggestions based on your job profile
vs
Similar Companies