Question: Write a program to create a class called series B . SeriesB has following methods and field. Static int Current Number Int getCurrent Number (

Write a program to create a class called series B. SeriesB has following methods and field.
Static int Current Number
Int getCurrent Number ()
setCurrent Number (int number)
Please create three threads from Main program
Thread 1 has to set Current Number as 112
Thread 2 has to set Current Number as 223.
Thread 3 has to set Current Number as 343.
Please ensure that thread outputs are always in the order 343,223,112,343,223,112.... using two thread synchronization approaches (method and block level)

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 Finance Questions!