Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread Question

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following statements are true?

Options

Select 1 correct option.

1.To provide threading behaviour a class must extend Thread class.
2.To provide threading behaviour a class must explicitly implement Runnable interface.
3.Threads created by user are always non-daemon threads.
4.Thread created internally by the JVM are always daemon threads.
5.None of the above are correct.

Answer Given is: option 5

I think option 3 is correct.

Comment
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#5 is correct. While threads created by your program are BY DEFAULT not daemon threads, you can indeed create them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic