how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread



how to create multithreaded program? Explain different ways of using thread? When a thread is create..

Answer / Krish

A multithreaded program can be created in Java by creating multiple Thread objects and starting them. There are two primary ways to create threads: extending the 'Thread' class or implementing the 'Runnable' interface.nnWhen a new thread is created and started, its initial state is NEW. After the start() method call, it transitions through various states: RUNNABLE (it can now execute), BLOCKED (if waiting for a lock), and TERMINATED (once the thread has completed execution).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Write a program to print count of empty strings in java 8?

0 Answers  


Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?

1 Answers  


Howmany number of objects we can store in an ArrayList. Is there any limit?

7 Answers   TCS,


Explain listiterator and methods in listiterator?

1 Answers  


What do you mean by object?

1 Answers  


Can a vector contain heterogenous objects?

1 Answers  


what is mutability?which one is mutable String or StringBuffer?and why?give examples of each which shows the mutability of each String or StringBuffer

4 Answers   IBM, Zenon,


What is the purpose of assert keyword used in jdk1.4.x?

1 Answers  


define the terminology association.

1 Answers  


Can you override a private or static method in java?

1 Answers  


what is the constructor and how many types of constructors are used in java?

1 Answers  


What does the append?

1 Answers  


Categories