Difference between start and run method in Thread? Example

Why to do one call start method of the thread if start() calls run() in turn" or "What is the difference by calling start() over run() method in java thread" are two widely popular beginner level multi-threading interview question. When a Java programmer start learning Thread, the first thing he learns is to implement thread either overriding run() method of Thread class or implementing Runnable interface and then calling start() method on the thread, but with some experience, he finds that start() method calls run() method internally either by looking API documentation or just poking around, but many of us just don’t care at that time until it been asked in Java Interview.

تعليقات

المشاركات الشائعة من هذه المدونة

Why use Underscore in Numbers from Java? Underscore in Numeric Literals Example

3 ways to convert String to Boolean in Java? Examples

Coursera's TensorFlow: Advanced Techniques Specialization Review [2022]