+ 2

What is the use of start in this program?

2nd Mar 2018, 5:59 AM
nitesh dalal
nitesh dalal - avatar
8 ответов
+ 5
java
2nd Mar 2018, 6:14 AM
Saravan Shanmugam
Saravan Shanmugam - avatar
+ 5
start() will start the thread, I mean call the run method to execute
2nd Mar 2018, 6:16 AM
Saravan Shanmugam
Saravan Shanmugam - avatar
+ 4
this is from java tutorial> craeting runnable interfaces
2nd Mar 2018, 6:14 AM
nitesh dalal
nitesh dalal - avatar
+ 4
in Java or C# , start() method use to execute the thread object by calling the run() method
2nd Mar 2018, 6:39 AM
Ali Abdulbasit
Ali Abdulbasit - avatar
+ 2
@jayden leCorpa...i want to ask that what is object.start() is doing?
2nd Mar 2018, 6:09 AM
nitesh dalal
nitesh dalal - avatar
+ 2
class Loader implements Runnable { public void run() { System.out.println("Hello"); } } class MyClass { public static void main(String[ ] args) { Thread t = new Thread(new Loader()); t.start(); } }
2nd Mar 2018, 6:11 AM
nitesh dalal
nitesh dalal - avatar
+ 2
thanks saravan
2nd Mar 2018, 6:17 AM
nitesh dalal
nitesh dalal - avatar
+ 1
ok bro ali thanks
2nd Mar 2018, 6:39 AM
nitesh dalal
nitesh dalal - avatar