I create a new thread like this:
Runnable r=new Runnable() {
public void run() {
// content
}
}
Thread th = new Thread();
th.start(r);
What is the priority of the newly constructed thread?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default when a new Thread is constructed,it runs at the same priority as the thread that constructed
it.Most new threads are constructed directly or indirectly by the main thread and will therefore run
at priority of 5.This works well under many scenarios,but there are times when you will want to
raise or lower a thread’s priority.
you can determine the current priority by calling
getPriority()on the thread whose priority you wantto check.