About thread | SoloLearn: Learn to code for FREE!

0

About thread

Is that "start" method from the "thread" class? Can anyone please answer.

11/8/2019 5:30:36 PM

Bibekananda Besra

2 Answers

New Answer

+2

Yes the start() is from Thread class which implements Runnable interface. Here is a small piece of code for you to understand it better. import java.util.*; public class Program { public static void main(String[] args) { A obj = new A(); obj.start(); } } class A extends Thread{ public void run(){ for(int i=1;i<=5;i++){ System.out.println(i); } } }

0

got it bro ... Thankkss s