In howmany ways a thread can be created?

Answer Posted / harish

There are two different ways to create a Thread. One is
extends Thread class and implement Runnable Interface.
Better to go for Runnable interface. It will have a method
run(). You should override in the sub class. Even, you
can extend another class to the same thread class.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the notifyall() method?

688


Can I run seam with jdk 1.4 and earlier?

636


Can I have an action without a form?

683


Is it possible to stop the execution of a method before completion in a sessionbean?

704


Are enterprise beans allowed to use thread.sleep()?

756






What value does read() return when it has reached the end of a file?

627


Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

642


Describe responsibilities of Activator?

1759


Where can I ask questions and make suggestions about seam?

697


What is difference between object state and behavior?

673


Can you control when passivation occurs?

684


What are the diff types of exception?

650


What is the difference between ear, jar and war file?

673


Is jvm a overhead?

699


Why does the tag url-encode javascript and mailto links?

675