when we applied start()method on a thread ,how does it know
that to execute run()method on that object?

Answers were Sorted based on User's Feedback



when we applied start()method on a thread ,how does it know that to execute run()method on that ob..

Answer / suma

When start method is called , JVM calls run method of this
object

Is This Answer Correct ?    7 Yes 0 No

when we applied start()method on a thread ,how does it know that to execute run()method on that ob..

Answer / sushant

Thread in a java inbuilt Object.
So if you are implementing threads in your system by using
Thread class or runnable interface, the JVM will look at
that and keep an eye on your code. As soon as you call the
start method it will go and call the run method on its own.
The funda here is that this is something that the JVM if
fully responsible of handling.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

What is ioc concept?

0 Answers  


Do we need to override service() method

0 Answers  


What is a class loader? What are the different class loaders used by jvm?

0 Answers  


Explain RMI Architecture?

0 Answers  


Write a program to show synchronization?

0 Answers  


Why won’t the jvm terminate when I close all the application windows?

0 Answers  


Does Java pass arguments by value or reference?

5 Answers   HeadStrong,


what is heepStored?

1 Answers  


what is a Daemon Thread?

2 Answers  


What method is invoked to cause an object to begin executing as a separate thread?

0 Answers  


What are the different approaches to represent an inheritance hierarchy?

0 Answers  


How are the elements of a cardlayout organized?

0 Answers  


Categories