Why we need Threads ?

Normally, Thread refers execution flow of control in a program. Handling threads in application is too complicate, suppose if you handling it wrong. In Java , We can handle threads easily with more productive.

Basic concurrency support functionality available in Java platform from first release. In Java 5.0, added high level concurrency API.

In Java, we can implement thread's in two ways.

Runnable Interface

Runnable is an interface has single method "run()". The code which contains in side run method is executed in thread. For this we need to provide Runnable object to Thread.

SHARE

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment