About thread | SoloLearn: Learn to code for FREE!


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


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); } } }


got it bro ... Thankkss s