Question: Hi guys, I am new to Java multi-threading. There are two techniques for creating threads in java programming. One approach is to create a new

Hi guys, I am new to Java multi-threading. There are two techniques for creating threads in java programming. One approach is to create a new class that is derived from the Thread class and override its run() method. The other technique is to define a class that implements the Runnable interface. So I get it the runnable interface is is defined as follows:

public interface Runnable {

public abstract void run();

}

As an example of how this works by creating a program. This program will be passed a series of numbers on the command line and will then create 3 separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum and the 3rd will determine the minimum value. Then the output will look like this

the average is 20

the maximum is 100

the minimum is 5

Any help is welcome. Plus if you could comment it out so that I can understand as well. Thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!