Question: java Or Question 5 [4 + 4) Write codes to perform the following two tasks: A. Create a thread class named NegativeFilter extending the Thread
java
Or Question 5 [4 + 4) Write codes to perform the following two tasks: A. Create a thread class named NegativeFilter" extending the Thread class. Inside the run method it should continuously take an integer as input from console and output to console if it's non-negative. Write the public Main class and inside the main method, create an object of "Negative Filter" and start the thread. B. Create a thread class named "Even Filter" implementing the Runnable interface. Inside the run method it should continuously take an integer as input from console and output to console if it's an odd number. Write the public Main class and inside the main method, create a thread object that takes an "EvenFilter" object and start the thread
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
