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
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.
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
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
- Creating own class that extends to parent Thread class.
- 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
Math,
8 months ago
Science,
8 months ago
Physics,
8 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
English,
1 year ago
French,
1 year ago