0
Hi guys,i have a qus,what do the start do(obj.start())? I will be grateful if you help me class Loader extends Thread { public void run() { System.out.println("Hello"); } } class MyClass { public static void main(String[ ] args) { Loader obj = new Loader(); obj.start(); } }
4 Answers
+ 2
using obj.run() would make the parent thread execute the function run(). using obj.start() would create a child and start the child execution at run()
+ 1
creates a thread which starts execution at the function run()
0
Thank you,but what is the diffrent between obj.start(); and obj.run(); ?
0
You are a Genius dude,thanksâïžđ