Write a program in JAVA to print EVEN and ODD numbers within a range using multithreading.
I was asked this question in Nokia Networks. You have to write a Java multithreaded program which will take the input range from user and print those numbers as Even or Odd.
Sample example:
Enter input range: 5
Odd: 1
Even: 2
Odd: 3
Even: 4
Odd: 5
Here is the implemented code:
Sample Output:
No comments:
Post a Comment