What are the two ways of implementing multi-threading in java?

Answer Posted / hrindows@gmail.com

Multi threaded applications can be developed in Java by using any of the following two methodologies:
1. By using Java.Lang.Runnable Interface. Classes implement this interface to enable multi threading. There is a Run() method in this interface which is implemented.
2. By writing a class that extend Java.Lang.Thread class.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java an open source?

530


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

550


Can we call the run() method instead of start()?

608


What are void pointers?

722


What is hashtable and explain features of hashtable?

570






What are keywords give examples?

588


Explain how to force the garbage collection in java.

543


Can we rethrow the same exception from catch handler?

571


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread

605


can used Protected Class outside Function.?

620


What is meant by collection in java?

566


What is unmodifiable list in java?

540


How do you create immutable object in java?

547


How to provide security in java

1814


Why does java have different data types for integers and floating-point values?

540