Computer Science, asked by yashormasandal3825, 11 months ago

Which of the following constructor of class Thread is valid one?
A.Thread(Runnable threadOb, int priority)
B.Thread(int priority)
C.Thread(Runnable threadOb, String threadName)
D.Thread(String threadName, int priority)

Answers

Answered by Avanish010
0
Hi there,

Which of the following constructor of class Thread is valid one?
A.Thread(Runnable threadOb, int priority)
B.Thread(int priority)
C.Thread(Runnable threadOb, String threadName)
D.Thread(String threadName, int priority).

Option C is correct.
Answered by letmeanswer12
1

"Option C: Thread(Runnable threadOb, String threadName) is the constructor of class Thread is valid one".

Thread in java:

In Java, a thread class has different method calls to manage the behavior of threads by providing constructors and methods to execute operations on threads programs.

Two Ways of creating threads

  1. Creating own class that extends to parent Thread class.
  2. Another one,Implementing the Runnable interface.

Thread is a program that begins with a method() often used in this class only called the start() method. This method looks for the run() method and starts running the body of the run() method.

Thread(Runnable target, String name) is used to allocate a new Thread object.

Similar questions