Question: This is in Java Instructions: write static methods for the following: 1. countOf - This method should take an integer, target, and an ArrayList of
This is in Java
Instructions: write static methods for the following: 1. countOf - This method should take an integer, target, and an ArrayList of integer, nums, as formal parameters and should return an int indicating the number of times target appears in nums. If the given target is less than 0 , then the method should return -1. If Example: countof (2,[4,2,0,2,2] ) should return the number 3 (as the target number 2 appears 3 times in the list). 2. call it from the main at least once. Once you've completed these steps, and the test cases are passing, you are finished with the coding portion of the quiz. LAB ACTIVITY 0/40 Downloadable files Quiz1A.java Load default template
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
