0 votes
in JAVA by
What is thread in java

1 Answer

0 votes
by
Threads allows a program to operate more efficiently by doing multiple things at the same time.

Threads can be used to perform complicated tasks in the background without interrupting the main program.

It can be created by extending the Thread class and overriding its run() method:

Extend Syntax

public class MyClass extends Thread {

public void run() {

System.out.println(“This code is running in a thread”);

}

}

Related questions

0 votes
asked Jan 24, 2020 in JAVA by rahuljain1
+1 vote
asked Jan 24, 2020 in JAVA by rahuljain1
...