Answer:
Following are the code to this question:
Counter T = new Counter(1, 100); //creating Counter class object and call its parameterized constructor
Thread T1 = new Thread(new Runnable() //creating Thread object T1.
{
public void run() //define run method
{
T.countRange(); //call countRange method
}
});
Thread T2 = new Thread(new Runnable() //creating another object "T2" of Thread.
{
public void run() //define run method
{
T.countRange(); //call countRange method
}
});
T1.start(); //start Thread T1
T2.start(); //start Thread T2
Explanation:
Description of the above code as follows:
- In the given code, inside the main method the Counter class object "T" is created, that calls its parameterized constructor, which accepts two integer value that is "1 and 100".
- In the next step, thread class object T1 and T2, is created, which uses run method, in which it called the countRange method inside the method a for loop is declared that prints value between parameter value.
- In the last step, the start method is called, which uses the run method to call countRange method.
- For full program code please find the attachment.
Hey there!
No, the internet is not a private place
I hope this helped! :-)
I think a video to post to your website would be very good
The camera is at the bottom of the screen,Take a pic
When you are trying to solve a formula like this one, you need to consider the whole row in the spreadsheet, not just A1 and D1.
So, A1:D1 refers to the whole row, which means that you need to add A1+B1+C1+D1 = 2 + 1 + 5 + 3 = 11.
The answer to the formula according to this spreadsheet is 11.