Question: Solve the following question in Java. Question 6: [10 marks] Write a class named PositiveEvenFinder that implements a method named findPositiveEvens to return an int
Solve the following question in Java.
![Solve the following question in Java. Question 6: [10 marks] Write a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f308ce096f4_53366f308cd6f79d.jpg)
Question 6: [10 marks] Write a class named PositiveEvenFinder that implements a method named findPositiveEvens to return an int array containing all of the positive and even numbers from the provided int array, as done in this python snippet: def positive_evens( numbers Purpose: Returns all the positive even numbers in the list numbers Pre: numbers: a list of integers Post: none Return: a list of positive even integers return [x for x in numbers if x % 2 = 0 and x > 0] Use the provided main method to test your code same as this python snippet: inputs- [1,2,3,4,5] result positive_evens (inputs) result !- [2, 41: print("Testing fault: positive_evens) returned",result, "on inputs",inputs, "(didn't find the correct even numbers)")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
