Java Programming - Threads - Discussion
Discussion Forum : Threads - General Questions (Q.No. 2)
2.
Which two are valid constructors for Thread?
- Thread(Runnable r, String name)
- Thread()
- Thread(int priority)
- Thread(Runnable r, ThreadGroup g)
- Thread(Runnable r, int priority)
Answer: Option
Explanation:
(1) and (2) are both valid constructors for Thread.
(3), (4), and (5) are not legal Thread constructors, although (4) is close. If you reverse the arguments in (4), you'd have a valid constructor.
Discussion:
11 comments Page 2 of 2.
Sudha said:
1 decade ago
Why 4th one is wrong, what is the main raeson.
I mean wether its syntactical error or else what.
I mean wether its syntactical error or else what.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers