Java Thread
Java Thread
1. How does Java handle multithreading, and what are the ways to
create threads in Java?
Java supports multithreading by allowing multiple threads to execute concurrently
within a single Java application. To create threads, you can use either of the following
methods:
1) Extending the Thread class and overriding the run() method.
2) Implementing the Runnable interface and providing the implementation for
the run() method.
3) Implementing the Callable interface with the call() method (Java's newer
approach, returning a result).