Question: For problems 22 and 23, write the Java code that is requested. Write a public and static Java method named count that takes an integer

For problems 22 and 23, write the Java code that is requested. Write a public and static Java method named count that takes an integer and an integer array as parameters, in that order, and returns an integer. The method counts the total number of occurrences of the specified integer in the array and returns the total. Write Java code to call the method defined above with the array called myArray, which is declared below, and the integer parameter set to the literal 14, and print the return value. After calling the method, print the array using Arrays.tostring(). You can assume that the required import statements have already been made.//Java coding int[] myArray = {7, 14, 35, 14, 123, 99, 14, 2, 7, 14, 55, 14}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
