Question
class newthread implements Runnable
{
Thread t1,t2;
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();
}
}
a.
true
b.
false
c.
truetrue
d.
falsefalse
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. Which object Java application uses to create a new process?
View solution
Q. Which of the following is true about Java system properties?
View solution
Q. Java system properties can be set at runtime.
View solution
Q. Which system property stores installation directory of JRE?
View solution
Q. What does System.getProperty(“variable”) return?
View solution
Q. What is true about the setProperties method?
View solution
Q. How to use environment properties in the class?
View solution
Q. How to assign values to variable using property?
View solution
Q. Which environment variable is used to set java path?
View solution
Q. How to read a classpath file?
View solution
Q. Which of the following would compile without error?
View solution
Q. Which of the following are valid calls to Math.max?
1. Math.max(1,4)
2. Math.max(2.3, 5)
3. Math.max(1, 3, 5, 7)
4. Math.max(-1.5, -2.8f)
View solution
Q. Which statement is true given the following?
Double d = Math.random();
View solution
Q. Which two statements are true about wrapper or String classes?
1. If x and y refer to instances of different wrapper classes, then the fragment x.equals(y) will cause a compiler failure.
2. If x and y refer to instances of different wrapper classes, then x == y can sometimes be true.
3. If x and y are String references and if x.equals(y) is true, then x == y is true.
4. If x, y, and z refer to instances of wrapper classes and x.equals(y) is true, and y.equals(z) is true, then z.equals(x) will always be true.
5. If x and y are String references and x == y is true, then y.equals(x) will be true.
View solution
Q. Which of the following will produce an answer that is closest in value to a double, d, while not being greater than d?
View solution
Q. What two statements are true about the result obtained from calling Math.random()?
1. The result is less than 0.0.
2. The result is greater than or equal to 0.0..
3. The result is less than 1.0.
4. The result is greater than 1.0.
5. The result is greater than or equal to 1.0.
View solution
Q. Which of these class have only one field "TYPE"?
View solution
Q. Standard output variable "out" is defined in which class?
View solution
Q. Which of the following is method of wrapper Float for converting the value of an object into byte?
View solution
Q. A command-line argument in Java is a value passedat the time of ___ a program.
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!